ssh
$ chmod go-rwx $HOME/.ssh/*
4. Type the following to copy the key to the remote server (replace chester with the
remote username and host2 with the remote hostname):
$ cd ~/.ssh
$ scp id_dsa.pub chester@host2:/tmp
chester@host2??™s password: *******
5. Type the following to add the ssh key to the remote user??™s authorization keys (the code
should be on one line, not wrapped):
$ ssh chester@host2 ???cat /tmp/id_dsa.pub >>
/home/chester/.ssh/authorized_keys2???
NOTE
221
Securing Linux 6
In the previous two steps you are asked for passwords. This is okay.
For the sshd daemon to accept the authorized_keys2 file you created, your home
directories and that file itself must have secure permissions. To secure that file and
those directories, type the following:
$ ssh chester@host2 chmod go-w $HOME $HOME/.ssh
$ ssh chester@host2 chmod 600 $HOME/.ssh/authorized_keys2
6. Type the following to remove the key from the temporary directory:
$ ssh chester@host2 rm /tmp/id_dsa.pub
You should not be asked for a password or passphrase in the previous step.
It is important to note that once you have this working, it will work regardless of how many times
the IP address changes on your local computer. The IP address has nothing to do with this form of
authentication.
Pages:
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481