8
6
A while back on StackOverflow, I asked this question about ssh-agent and crontab. I have a similar question now about ssh-agent and screen on linux systems.
So, on my Mac, ssh-agent launches at system startup, so it's always available to me. I think it would be true under my linux (redhat el5/fedora) if I were using X-Windows. However, this is a remote server machine and I'm always logging in via ssh.
I would love to have ssh-keys set up properly so I didn't have to enter my password multiple times during an svn update or commit. I'm happy to type in my passphrase once per session, and I discourage our team from having password-less ssh-keys.
For a brief shining moment, it seemed like doing "eval `ssh-agent -s`" in my .bash_profile, paired with a command to kill the ssh-agent when I logged out, would work. However, we make heavy use of screen in order to manage long-running interactive programs and development environments. If you start & stop ssh-agent as I just described, then it gets killed when you exit out of the terminal, and the screen's sub-sessions which used to be referring to that ssh-agent instance are abandoned.
So ... how can I be a console user, who uses screen, who uses a password with his ssh-keys, who doesn't have to type in the passphrase constantly?
The initscript idea is interesting -- basically, just start it at system startup for all users who want it? That could work. We don't have a lot of users who would care.
Whether or not that's significantly better than not having a passphrase at all is an interesting question, since I suspect that means you'd only have to enter it once per machine restart. Hmm.
Both that and the second suggestion rely on new terminal sessions being able to connect to the ssh-agent if it's already running. I'm not completely sure it's that easy, but I haven't tried yet. Thanks for the ideas! – Michael H. – 2010-07-01T02:44:19.250
@khedron: Yep, but you'd have to put one line in
/etc/conf.d/local
(or your equivalent) for each user who uses the agent, to launch a separatessh-agent
process per user. If, as you say, you don't have a huge number of users, that wouldn't be too bad. You raise a good point (which I forgot to consider) about terminal sessions attaching to the agent; see my edit to the answer. – David Z – 2010-07-01T05:57:31.037