How to generate and install ssh keys in order to avoid being prompted for a password every time you use ssh.
The new way (simpler)¶
On the machine FROM WHICH you will connect to others:
mkdir -p ~/.ssh chmod 700 ~/.ssh ssh-keygen -f ~/.ssh/id_rsa -t rsa # for each desired host (including localhost), do: ssh-copy-id <username>@<host> ssh username@host 'echo Hello'
... where username and host are the other machines you will connect to (including localhost).
The old way¶
Here is how to generate a key:
ssh-keygen
Once this is done, you need to issue the following for each host you want to avoid typing the password for:
We put a modified version of the ssh-keyinstall script in postures/trunk/scripts.
cd ~/src/postures/trunk/scripts ./ssh-keyinstall -s dummyhostname -u dummyusername ssh -l dummyusername dummyhostname 'echo HI'
A bug under gnome¶
When using gnome, after some time the gnome-keyring-daemon makes ssh-agent crash.
So the workaround is to disable gnome-keyring ssh support.
To get a graphical prompt for you ssh keys at login (since gnome-keyring won't prompt you for them anymore), add "ssh-add l" in your Startup Applications (System>Preferences). br
Image(ssh-add.png, nolink)