zoukankan      html  css  js  c++  java
  • 快速配置SSH证书登录

    环境:
    在 CentOS 5/6/7、RHEL 5/6/7 和 Oracle Linux 6/7 上测试通过
    使用 ssh-key-gen 命令生成公钥和私钥
    用 ssh-copy-id 命令将公钥复制或上传到远程主机,并将身份标识文件追加到节点2的 ~/.ssh/authorized_keys 中
    用户是root

    1. [root@node1 ~]# ssh-keygen
    2. Generating public/private rsa key pair.
    3. Enter file in which to save the key (/root/.ssh/id_rsa):
    4. Enter passphrase (empty for no passphrase):
    5. Enter same passphrase again:
    6. Your identification has been saved in /root/.ssh/id_rsa.
    7. Your public key has been saved in /root/.ssh/id_rsa.pub.
    8. The key fingerprint is:
    9. b4:51:7e:1e:52:61:cd:fb:b2:98:4b:ad:a1:8b:31:6d root@node1.ehowstuff.local
    10. The key's randomart image is:
    11. +--[ RSA 2048]----+
    12. | . ++ |
    13. | o o o |
    14. | o o o . |
    15. | . o + .. |
    16. | S . . |
    17. | . .. .|
    18. | o E oo.o |
    19. | = ooo. |
    20. | . o.o. |
    21. +-----------------+

    1. [root@node1 ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.0.10
    2. root@192.168.0.10's password:
    3. Now try logging into the machine, with "ssh '192.168.0.10'", and check in:
    4. .ssh/authorized_keys
    5. to make sure we haven't added extra keys that you weren't expecting.
    1. [root@node1 ~]# ssh root@192.168.0.10
    2. Last login: Sun Dec 13 14:03:20 2015 from www.ehowstuff.local

















  • 相关阅读:
    模块的搜索路径
    循环导入问题
    模块的四种形式
    匿名函数
    面向过程编程
    内置函数
    名称空间和作用域
    函数嵌套
    函数对象
    可变长参数
  • 原文地址:https://www.cnblogs.com/echorep/p/5173399.html
Copyright © 2011-2022 走看看