Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.