两步完成ssh免密码登录

1.生成公钥/私钥

ssh-keygen -N ''

生成公钥在/root/.ssh目录下。

2.分发公钥

ssh-copy-id root@192.168.137.141

192.168.137.141是需要免密码登录的目标。

自动生成known_hosts文件

测试

ssh root@192.168.137.141

 

远程端192.168.137.141会生成authorized_keys文件。

 

posted @ 2018-05-10 16:10  扶苏公子x  阅读(412)  评论(0编辑  收藏  举报