Running SSH-Agent on login
by Sylvester Ink from LinuxQuestions.org on (#51VET)
I'm trying to have ssh-agent run in the background when I log in. I don't need it to add any keys until I specify them during my session, but after that those keys should be usable until I log out. It's been suggested that the best way to maintain all this is to use the Keychain tool, but I'm still having issues with that.
If I use the command
Code:eval `keychain --eval --agents ssh id_rsa`directly from the command line in xterm, I can then use that key just fine, but only in that terminal. If I try to use it in another running instance of xterm, it won't work. If I try to use it in a fresh xterm instance, it won't work.
I guess I'm supposed to start ssh-agent either in my i3 config, or in my bash-profile/zprofile, but I haven't had luck with those either. What am I missing?
As a bonus question, I'd like to eventually change this to use gpg-agent to manage my keys, but for now, I'd just like to get ssh working.


If I use the command
Code:eval `keychain --eval --agents ssh id_rsa`directly from the command line in xterm, I can then use that key just fine, but only in that terminal. If I try to use it in another running instance of xterm, it won't work. If I try to use it in a fresh xterm instance, it won't work.
I guess I'm supposed to start ssh-agent either in my i3 config, or in my bash-profile/zprofile, but I haven't had luck with those either. What am I missing?
As a bonus question, I'd like to eventually change this to use gpg-agent to manage my keys, but for now, I'd just like to get ssh working.