Set up SSH Key Pairs Using DSA
- Run the ssh command that sets up the key pair:
% ssh-keygen -t dsa
- At the following prompt, press Enter to accept the default key location, or type another:
Generating public/private dsa key pair. Enter file in which to save the key (~/.ssh/id_dsa):
- Press return at the password prompt:
Enter passphrase (empty for no passphrase):
- Press Return again to confirm the password:
Enter same passphrase again:
You should see the following information:
Your identification has been saved in ~/.ssh/id_dsa Your public key has been saved in ~/.ssh/id_dsa.pub The key fingerprint is: <Some really long string>
If SSH continues to prompt you for your password, verify your permissions in your remote
.ssh
directory. It should have only your own read/write/access permission (octal 700):% chmod 700 ~/.ssh
- Open the local
~/.ssh/id_dsa.pub
file and paste its contents into the~/.ssh/authorized_keys
file on the remote host. - Update the permissions on the
authorized_keys
file on the remote host as follows:% chmod 600 ~/.ssh/authorized_keys