I write this post mainly as a reminder, but it might be also usefull for some people.
Requirements : openssh-client
Open a terminal and type this command to generate the key pair (private/public) :
ssh-keygen -t dsa -b 1024
You need to answser to two questions :
First, where do you want to save the keys ?
The default (/home/username/.ssh/id_dsa) is usually a good choice, so just hit Enter here, or give a path and a name for your key.
Second, what passphrase ?
This passphrase will be asked once per session. You can hit Enter with an empty passphrase, but that means no passphrase, which is really a bad choice in terms of security.
Now we copy the public key on the remote server like this (assuming your remote server hostname is myserver.host.org and your remote user on this server is myuser) :
ssh-copy-id -i ~/.ssh/id_dsa.pub email@example.com
Then try to log into the remote server :
The first time, you'll be prompted for your passphrase. the passphrase won't be asked anymore until you log out/in your session.
Create nifty ssh shorcuts :
To avoid typing the whole firstname.lastname@example.org string you can create shortcuts in ssh config file. Open or create it with gedit like this :
For each remote server, add a section like this :
Host myserver Hostname myserver.host.org User myuser
Now, you can log in to your remote server like this :
Completion also work here :