[root@localhost ~]# vim /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
其余的步骤和开始的一样如下所示:
[linuxidc@localhost ~]$ ssh-keygen -t dsa -P ''
Generating public/private dsa key pair.
Created directory '/home/linuxidc/.ssh'.
Your identification has been saved in /home/linuxidc/.ssh/dsa.
Your public key has been saved in /home/linuxidc/.ssh/dsa.pub.
The key fingerprint is:
15:57:37:f1:ee:05:26:3a:9e:e1:aa:b3:11:27:b3:1a linuxidc@localhost.localdomain
The key's randomart image is:
+--[ DSA 1024]----+
| . ...oo|
| o .o|
| . . o .|
| . . o o |
| + S + o|
| * o + ..|
| E o + .|
| o.. . |
| . o+. |
+-----------------+
[linuxidc@localhost ~]$ cat ~/.ssh/dsa.pub >> ~/.ssh/authorized_keys
[linuxidc@localhost ~]$ ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is f3:f8:0b:26:a1:8e:14:55:34:ec:cb:99:f8:70:2c:d3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
Last login: Fri Aug 9 08:39:32 2013 from 192.168.142.1
[linuxidc@localhost ~]$
好了,配置完成了。
相关阅读: