码迷,mamicode.com
首页 > 系统相关 > 详细

xshell 使用密钥验证远程登录linux

时间:2015-03-11 02:01:32      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:服务器   linux   远程登录   

使用xshell做密钥验证远程登录linux:

我这里用的工具:xshell 5 及 centos 6.5



首先在工具栏选择新建用户密钥生成向导,进行密钥对生成操作

技术分享

技术分享

  下一步

技术分享

生成公钥对,下一步

技术分享


这里也可以直接点“完成”,这里选“下一步”(原因看下一张图)

技术分享


选中公钥复制,保留,或者保存为文件,后面要用到

技术分享


在服务器端,保存公钥到服务器,修改相关文件

[root@localhost ~]# mkdir .ssh

[root@localhost ~]# vim .ssh/authorized_keys 将复制的公钥粘贴到此文件

修改权限

[root@localhost ~]# chmod 600 .ssh/authorized_keys

[root@localhost ~]# chmod 700 .ssh

关闭selinux

[root@localhost ~]# setenforce 0  临时修改

[root@localhost ~]# vim /etc/selinux/config 

技术分享


[root@localhost ~]# iptables -F  清空iptables

[root@localhost ~]# service iptables save

设置启用密钥登录

[root@localhost ~]# vim /etc/ssh/sshd_config

技术分享


[root@localhost ~]# service sshd restart  重启sshd


至此,设置xshell使用密钥登录

技术分享


xshell 使用密钥验证远程登录linux

标签:服务器   linux   远程登录   

原文地址:http://wangwq.blog.51cto.com/8711737/1619161

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!