xshell 使用密匙 来登录远程主机(Centos 6.5)

时间:2021-07-20 04:46:43

xshell 使用密匙 来登录远程主机(Centos 6.5)

实验用软件:

windows客户端:

1. xshell5 下载地址:  http://pan.baidu.com/s/1ESfQQ

2. xftp5 下载地址:  http://pan.baidu.com/s/1o6p1j3G

Linux服务端:

1. sshd 下载: yum install -y sshd

操作过程:


1. 打开Xshell点击菜单栏的Tools -> New User Key Wizard..

 

xshell 使用密匙 来登录远程主机(Centos 6.5)



2. 选择key type: RSA (可以根据自己喜好,这里我就是用RSA了), 下一步 

 xshell 使用密匙 来登录远程主机(Centos 6.5)



3. 直接下一步了

 xshell 使用密匙 来登录远程主机(Centos 6.5)



4. 给密匙取个名字, 可以对密匙进行加密, 测试关系我就不加密了, 可以自行设置密码

 xshell 使用密匙 来登录远程主机(Centos 6.5)



5. 设定密匙协议为SSH2相对安全, 因为SSH1不安全, 设置存盘位置, 公钥搞定

 xshell 使用密匙 来登录远程主机(Centos 6.5)

xshell 使用密匙 来登录远程主机(Centos 6.5)

 


6. 把刚才做好的密匙文件上传到服务器, 我就上传到root的家目录里面了.(/root/)

xshell 使用密匙 来登录远程主机(Centos 6.5)



7. 把上传好的文件内容重定向到要登录的用户家目录下 .ssh/authorized_keys 文件中

[root@localhost ~]# pwd/root
[root@localhost ~]# mkdir .ssh
[root@localhost ~]# cat id_rsa_1024_mykey1.pub >> .ssh/authorized_keys



8. 重新使用xshell来登录,选择刚才生成的那个密匙

 xshell 使用密匙 来登录远程主机(Centos 6.5)

结束


本文出自 “帝国金菜园子” 博客,请务必保留此出处http://diguojin.blog.51cto.com/5034509/1554838