I want to be able to connect to a server, start a sudo shell, then use agent forwarding to connect to another server (in order to use SCP to copy files to a protected area). But:
ubuntu@tunnelator:/var/www$ ssh -p 10022 stevebennett@localhost Last login: Fri Apr 5 10:54:03 2013 from localhost ~ exit Connection to localhost closed. ubuntu@tunnelator:/var/www$ sudo ssh -p 10022 stevebennett@localhost Password:
Presumably, starting the sudo shell is killing the agent forwarding. The difference is this:
debug1: Offering RSA public key: id_rsa debug1: Server accepts key: pkalg ssh-rsa blen 277 debug1: Authentication succeeded (publickey).
debug1: Next authentication method: publickey debug1: Trying private key: /root/.ssh/id_rsa debug1: Trying private key: /root/.ssh/id_dsa debug1: Trying private key: /root/.ssh/id_ecdsa debug1: Next authentication method: keyboard-interactive
Is there a way to make this work? (The setup is roughly as described here: http://codysoyland.com/2010/jun/6/ssh-tip-automatic-reverse-tunnels-workflow-simplif/)