centos7 設定ssh免密碼登入配置方法

王聰聰發表於2018-04-22

生產金鑰:

[root@localhost hadoop]# ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa): 
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
2d:3f:49:17:bc:65:8e:71:1c:c0:2f:66:a0:80:ea:22 root@localhost.localdomain
The key's randomart image is:
+--[ DSA 1024]----+
|     .     ....  |
|    . .   .... . |
|   .   . . .+.=  |
|  .     ..  +X.  |
| .      S oo+..  |
|E .      + o     |
|..        +      |
|           .     |
|                 |
+-----------------+
複製程式碼
[root@localhost .ssh]# cat ./id_dsa.pub >>  ./authorized_keys

複製程式碼
[root@localhost .ssh]# ssh localhost
The authenticity of host 'localhost (::1)' can't be established.
ECDSA key fingerprint is 52:4a:ab:41:21:60:8a:5e:c9:85:81:81:97:bd:9c:52.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
Last login: Sat Apr 21 22:32:15 2018 from 192.168.1.3

複製程式碼

相關文章