I have an ssh script which use ssh key forwarding on a remote system to do thing in even more remote systems.
I have to run the script in a screen session so that I can detach from it. But the authorization that was granted to the remote system by ssh-key-forwarding needs to be present. Atleast until the script has finished.
Any ideas how to go about it?
If you disconnect, then the ssh agent socket gets closed. There is no way you can use agent forwarding if ssh closed. The private key is loaded in the agents memory. It is not copied in any way to the systems you have forwarded to. When you disconnect the private key will be unavailable.
Your only option would be to create or copy a keypair onto that system, or stay connected.