SSH with keys

Execute on local host, under user’s pwd:

$ mkdir -p ~/.ssh
$ chmod 700 ~/.ssh
$ cd ~/.ssh
$ ssh-keygen -t dsa

Copy the public key to the remote host

$ scp -p id_dsa.pub remoteuser@remotehost:
Password: *********

Log into remote host and install public key

$ ssh remoteuser@remotehost
Password: ********

remotehost$ mkdir -p ~/.ssh
remotehost$ chmod 700 ~/.ssh
remotehost$ cat ida_dsa.pub >> ~/.ssh/authorized_keys
remotehost$ chmod 600 ~/.ssh/authorized_keys
remotehost$ mv id_dsa.pub ~/.ssh
remotehost$ logout

Post a Comment

You must be logged in to post a comment.