1.本地生成公钥和私钥
[root@172 test]# ssh-keygen
2.将生成的公钥上传到远程电脑上
[root@172 test]# ssh-copy-id joninzhao@192.168.10.99
提示输入密码时,输入远程电脑密码,然后回车。
joninzhao@192.168.10.99's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'joninzhao@192.168.10.99'"
and check to make sure that only the key(s) you wanted were added.
3.在本地验证配置是否成功
[root@172 test]# ssh 'joninzhao@192.168.10.99
连接时不需要密码,则成功。其他情况失败。