1、使用windows上的SecureCRT生成密钥对。
Tools->Create Public Key..->RSA->Passphrase(最好输入,也可为空)->长度默认1024->选择 OpenSSH Key format->选择位置保存。
2、创建session,SSH2属性中的Authentication只选中PublicKey,单击Properites,选择Use Session public key setting和第一步生成的xxx.pub后确定。
3、将生成的xxx.pub上传到linux服务器上的~/.ssh目录下,如果没有则创建并将其属性改成700。
4、将xxx.pub放入~/.ssh/authorized_keys文件中,并将文件属性改成600
5、使用root身份修改/etc/ssh/sshd_config文件
PermitEmptyPasswords no
PasswordAuthentication no
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
6、重启sshd服务
sudo service sshd restart
7、使用securecrt连接linux服务器即可,第一次出现输入对话框,输入密码然后选择accept and save。
原文:http://www.cnblogs.com/zxpo/p/3862664.html