Using an SSH key to connect to the server allows you to log in without entering your password.
To generate an SSH key on Mac OS X or Linux machines:
- Open a Terminal window and enter:
ssh-keygen -d
Unless you set an alternative local storage location when prompted, your public key will be stored in ~/.ssh/id_dsa.pub. For increased security enter a passphrase when prompted, however this is probably not necessary unless many people use your computer.
- At the command line enter the following and copy the output to the clipboard.
cat ~/.ssh/id_dsa.pub
- Log in to the server.
- Switch into the ssh directory:
cd .ssh
- Type:
vi authorized_keys
- Paste your public key from the clipboard, then save and exit vi.



The “-d” shortcut does not exist in *nix systems. In general, you want to use
ssh-keygen -t dsa
By Rob Rosenbaum on Apr 8, 2008
It seems that the proper permissions for the authorized_keys file is “644″ or “-rw-r–r–”.
By Scott Meves on Jul 7, 2008