Setting up SSH key authentication on Linux/UNIX

From froelix.com - Wiki
Revision as of 09:18, 14 June 2013 by Froelix (Talk | contribs) (Created page with ''''Create the ''.ssh'' directory on the server (if it doesn't exist yet):''' $ mkdir ~/.ssh $ chmod 700 ~/.ssh '''On the client run the following commands:'''<BR> (Don’t ent…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Create the .ssh directory on the server (if it doesn't exist yet):

$ mkdir ~/.ssh
$ chmod 700 ~/.ssh

On the client run the following commands:
(Don’t enter a passphrase unless you want to type it every time you want to use the key)

$ ssh-keygen -t dsa
$ chmod 700 ~/.ssh
$ chmod 600 ~/.ssh/id_dsa
$ chmod 644 ~/.ssh/id_dsa.pub
$ scp ~/.ssh/id_dsa.pub <server hostname>:~/.ssh/

And on the server run these commands:

$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys2
$ chmod 600 ~/.ssh/authorized_keys2