Authenticating By Public Key In Open SSH
To setup public-key authentication between an OpenSSH client and OpenSSH server.
- Generate key on client_machine
client_machine$mkdir -p ~/.ssh client_machine$chmod 700 ~/.ssh client_machine$cd ~/.ssh client_machine$ssh-keygen -t dsa
- Copy the public key to the remote machine.
$scp -p id_dsa.pub user@remote_server:/home/user/.ssh/authorized_keys
Password
p Preserves modification times, access times, and modes from the
original file.
- Login to the remote server and make the following changes.
remote_server$chmod 700 ~/.ssh remote_server$chmod 600 ~/.ssh/authorized_keys remote_server$logout