11.ssh-keygen的使用方法

1、环境:两台linux主机,虚拟机也可以;我用的是两台centos7;

2、管理主机:192.168.110.115

     目标主机:192.168.110.132

3、在管理主机192.168.110.115上:

     ssh-keygen;

     两次或者三次enter,(不用输入参数,默认参数即可)

4、在管理主机192.168.110.115上:

     scp  .ssh/id_rsa.pub  [email protected]:/root/.ssh/

     依提示,输入目标主机(192.168.110.132)root用户的密码

5、ssh 192.168.110.132

      依提示,输入目标主机(192.168.110.132)root用户的密码,进入目标主机;

      cat .ssh/id_rsa.pub >> .ssh/authorized_keys

       exit;

6、ssh 192.168.110.132

      免密即可进入目标主机

猜你喜欢

转载自blog.csdn.net/kevinsingapore/article/details/80696638