ssh-agent key timeout with screen or tmux on bastion host

Posted by Jericon on Super User See other posts from Super User or by Jericon
Published on 2012-06-19T07:55:47Z Indexed on 2012/06/19 9:19 UTC
Read the original article Hit count: 417

Filed under:
|
|
|
|

Normally I have ssh-agent running, I ssh to my bastion host then open a tmux session and connect to other boxes through that. Key forwarding works for any sessions that I open from that point forward.

If I resume my tmux session after closing terminal, sleeping my laptop, whatever, my key forwarding on my bastion sessions still work, as does forwarding on any new sessions. Existing ones don't work, though.

I have a little thing in my bashrc that keeps key forwarding working when I resume tmux, but I am having trouble figuring out how to get it to keep working for sessions open within tmux.

For example, I have bastion01, dbhost01, dbhost02, webhost01, and webhost02.

If I open a connection to bastion01, start tmux there, and then connect to dbhost01 and webhost01 forwarding works. If I close that connection, reconnect and attach my existing tmux session, then add connections to dbhost02 and webhost02, key forwarding works on the 02 boxes, but does not on the 01.

Please help!

© Super User or respective owner

Related posts about ssh

Related posts about screen