Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ssh-agent with passwords without spawning too many processes

Tags:

linux

ssh

I use ssh-agent with password-protected keys on Linux. Every time I log into a certain machine, I do this:

eval `ssh-agent` && ssh-add

This works well enough, but every time I log in and do this, I create another ssh-agent. Once in a while, I will do a killall ssh-agent to reap them. Is there a simple way to reuse the same ssh-agent process across different sessions?

like image 267
Lorin Hochstein Avatar asked Sep 19 '08 14:09

Lorin Hochstein


People also ask

Is ssh-agent forwarding safe?

Agent forwarding comes with a risk When you forward ssh-agent 's Unix domain socket to a remote host, it creates a security risk: anyone with root access on the remote host can discreetly access your local SSH agent through the socket. They can use your keys to impersonate you on other machines on the network.

Is ssh-agent per user?

ssh directory exists. That you only want one ssh-agent socket per user on the system. That the HOME environment variable is set (because why wouldn't it, right?). That you will manually handle a situation where there is a process running, but it for some reason doesn't use the socket file designated.

How do I stop ssh from prompting key passphrase?

Use ssh-add to add the keys to the list maintained by ssh-agent. After you add a private key password to ssh-agent, you do not need to enter it each time you connect to a remote host with your public key.

Does ssh-agent need to be running?

On most Linux systems, ssh-agent is automatically configured and run at login, and no additional actions are required to use it. However, an SSH key must still be created for the user. The ssh-agent command outputs commands to set certain environment variables in the shell.


1 Answers

have a look at Keychain. It was written b people in a similar situation to yourself. Keychain

like image 59
Aaron Arbery Avatar answered Oct 23 '22 21:10

Aaron Arbery