windows登陆远程Linux主机的一种途径putty-详细安装使用过程 使用Linux主机生成的密匙 1、生成密匙
[root@gliethttp
.ssh]#ssh-keygen -t rsa Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): Enter
passphrase
(empty for no passphrase): Enter same passphrase again: Your
identification has been saved in /root/.ssh/id_rsa. Your public
key has
been saved in /root/.ssh/id_rsa.pub. The key fingerprint is:
e4:9a:47:a7:b4:8a:0b:98:07:b8:70:de:6b:16:2c:0c 2、将
/root/.ssh/id_rsa.pub改名为/root/.ssh/authorized_keys
[root@gliethttp .ssh]#mv /root/.ssh/id_rsa.pub
/root/.ssh/authorized_keys 3、将私钥id_rsa拷贝到远程客户端
1)、如果远程客户端是linux,拷贝到远程客户端/root/.ssh/即可 2)、putty作为远程客户端在
putty不能识别直接从服务器拷贝来的私钥,需要使用puttygen.exe进行格式转换 (1)、打开puttygen.exe
-->
Conversions --> Import Key (2)、选择拷贝过来的私钥文件id_rsa
(3)、Save
private key->id_rsa.ppk(保存私钥) 4、打开putty.exe 1)、Session
--> Host
Name (填写服务器地址或者域名) 2)、Connection --> SSH --> Auth
(点Browse选择刚生成的id_rsa.ppk) 3)、open 成功打开后出现如下提示: login
as:
root Authenticating with public key "imported-openssh-key"