zoukankan      html  css  js  c++  java
  • Linux之SSH免密登录

    实验方法:

    1. 开启两台虚拟机A和B,IP地址分别为192.168.222.12、192.168.222.10

    2. 在虚拟机A下做如下操作,生成公钥和密钥:

       [root@localhost ~]# ssh-keygen -t rsa
      
    3. 连续3次回车,结果如下:

    4. 此时可以进入/root/.ssh查看:

       [root@localhost ~]# cd /root/.ssh
       [root@localhost .ssh]# ls
      

    5. 同样的操作在B虚拟机上做一遍。

    6. 如果想A机器登录到B机器,则:

       [root@localhost .ssh]# scp /root/.ssh/id_rsa.pub root@192.168.222.10:/root/.ssh/authorized_keys
      
    7. 上一步回车之后:

    8. 在ssh目录下查看:

       [root@localhost .ssh]# ls
      

    9. 如果需要B登录到A,操作是一样的,只是注意(远程拷贝scp那行命令)IP地址

    10. 所有步骤完成,最后一步验证登录

      [root@localhost .ssh]# ssh 192.168.222.10
      

  • 相关阅读:
    资源限制
    垃圾收集器
    GC日志
    happens-before
    maven相互依赖导致无法编译成功
    LVM-逻辑卷常用命令和示意图
    取消RAID5
    扩展RAID5的容量
    模拟RAID5损坏
    创建RAID5
  • 原文地址:https://www.cnblogs.com/MisterZZL/p/9614342.html
Copyright © 2011-2022 走看看