I want to link some passwordless SSH logins to some screen
sessions, so that anytime a window is opened in the screen session the ssh-agent is inherited, but whenever I open a new window in screen, the ssh-agent reverts back to the main sessions settings.
This is what I'm attempting but it doesn't work:
Before I start the screen
session, I run eval `ssh-agent`
. This ensures that the main ssh-agent which is set via key-chain doesn't get passed on.
However when I run screen
it reverts back to the main ssh-agent's settings, and even when I run eval `ssh-agent`
again within that window, the settings don't carry on to the next window.
Is there some way to run an ssh-agent
session that can be carried on to each new window within screen
?
In sum, I think I need to select which ssh-agent
I should use whenever I open a new terminal window. If I have a number of ssh-agent
sessions running, is there a way to choose which one a newly opened terminal window, or even an existing terminal window should use?
screen -X setenv SSH_AUTH_SOCK $SSH_AUTH_SOCK
.