$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/paddingme/.ssh/id_rsa): test
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in test.
Your public key has been saved in test.pub.
The key fingerprint is:
1 本地生成公钥和私钥
这里命名为 test( 生成之后公钥为 test.pub 私钥 test 位于 ~/.ssh 下)
2 发送公钥到远程服务器上
3 测试是否可以免密登录
不行的话
登录远程服务器 vim /etc/ssh/sshd_config 找到 以下三行去行首#号
保存退出
ok!再测试