centos7 设置ssh免密码登录配置方法

生产密钥:

[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

复制代码
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值