In Ubuntu Maverick and higher, there is another method using the
- You need a Launchpad account so login or create an account
- After logging in, click the button next to SSH keys:
Paste the contents of your public key file in that field (including comment). Such a key looks like:
ssh-rsa AAAAB3Nza .... UyDOFDqJp lekensteyn
ssh-rsa indicates that the key is a RSA key,
AAAAB3Nza .... UyDOFDqJp is the actual key and
lekensteyn is the comment.
- Save the key by pressing Import Public Key
- If everything went well, your key should now be listed under SSH keys:
ssh-import-id needs to be installed on the machine which needs to be accessed from remote. This package is installed together with the
openssh-server package as it's a recommended package for
openssh-server. After making sure that
ssh-import-id has been installed On the client machine, run:
ssh-import-id [launchpad account name]
This will download the public key from the Launchpad servers over HTTPS which protects you from MITM attacks.
On Ubuntu Lucid and before, you can accomplish the same with:
wget https://launchpad.net/~[lp acount name]/+sshkeys -O - >> ~/.ssh/authorized_keys && echo >> ~/.ssh/authorized_keys
echo command is needed to get an extra newline after the line with the SSH key.