Putty使用private key进行ssh登录

Standard
[yemaosheng.com@svr ~]$ cd /home/yemaosheng.com/.ssh
[yemaosheng.com@svr .ssh]$ ssh-keygen -t dsa
[yemaosheng.com@svr .ssh]$ ls
id_dsa  id_dsa.pub  known_hosts
[yemaosheng.com@svr .ssh]$ cat id_dsa.pub > authorized_keys
[yemaosheng.com@svr .ssh]$ chmod 600 authorized_keys
[yemaosheng.com@svr .ssh]$ sz id_dsa* #下载id_dsa*,装有szrz工具

下载putty、pageant、puttygen,并将其放在同一目录.
下载地址:http://www.putty.org

运行puttygen

如上图,选”File”菜单中”的Load Private Key”导入之前下载的id_dsa文件,生成id_dsa文件时输入passphrase的话此时会有提示输入密码.导入后如下图,可点”Save private key”按钮导出一个*.ppk的putty专用的私钥文件.

运行pageant
会在右下角任务栏里有个帽子图标.右键点选”Add Key”添加ppk私钥文件,如私钥设有密码此时会提示输入.
最后,右键”New Session”新建服务器连接会话.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.