分类: LINUX
2008-06-04 14:09:17
1. 使用PuTTY客户端
先到PuTTY网站去下载putty.exe, psftp.exe, puttygen.exe
Link:
The latest release version (beta 0.60). This will generally be a version I think is reasonably likely to work well. If you have a problem with the release version, it might be worth trying out the latest development snapshot (below) to see if I've already fixed the bug, before reporting it to me.
| For Windows 95, 98, ME, NT, 2000, XP and Vista on Intel x86 | ||||
| PuTTY: | ||||
| PuTTYtel: | ||||
| PSCP: | ||||
| PSFTP: | ||||
| Plink: | ||||
| Pageant: | ||||
| PuTTYgen: | ||||
1.1 使用puttygen.exe生成密钥




将公钥上传到服务器
打开psftp.exe,然后使用open来打开指定的主机,这里是我虚拟机上的IP:192.168.32.227, 接着使用put命令上传公钥到服务器上,(注意:公钥必须要在psftp.exe运行的当前目录)
1.3 使用putty.exe登录到服务器上进行设置

登录到服务器上进行设置
使用putty.exe登录到服务器上,将刚刚上传的公钥移动到/root或用户目录的.ssh目录下,我这里是root用户。如果没有.ssh目录存在,则先创建.ssh目录。并且设置目录权限为所有者读写和执行,其他的都没有任何权限。这一步一定要执行,否则会使密钥无效。
|
|
然后进入.ssh目录,执行以下命令:
|
|
以上是把上传的公钥转换成Openssh可以认的公钥格式,否则使用putty.exe将连接不上。
然后也要把文件authorized_keys 权限设置为所有者读写和执行,其他的都没有任何权限(600)。这一步一定要执行,否则会使密钥无效。


