1、下载生成密钥工具 putty工具包里面的puttygen.exe


spacer.gifwKiom1T_4BTTH4dyAALJKlSJf4w807.jpg


(1)双击puttygen 生产密钥对
(2)私钥保存在自己电脑隐秘的地方,防止丢失,公钥复制待粘贴
(3)linux上创建目录 mkdir /root/.ssh; chmod 700 .ssh
(4)创建文件 vi /root/.ssh/authorized_keys  把复制好的公钥粘贴进来,保存后修改权限chmod 600 /root/.ssh/authorized_keys
(5)关闭selinux : setenforce 0   ; 清除iptables规则,并保存: iptables -F; service iptables save
(6)putty登录的时候,在左侧,点SSH --> Auth --> Browse 选择私钥



spacer.gifwKiom1T_4ISiqRIBAAI4rdtZR8U330.jpg



spacer.gif

root用户登录,输入生成密钥时设置的密码,进入界面如下:

1
2
3
4
5
login as: root
Authenticating with public key  "rsa-key-20150311"
Passphrase  for  key  "rsa-key-20150311" :
Last login: Wed Mar 11 19:26:27 2015 from 192.168.20.1
[root@localhost~] #