您的位置:首页 > 运维架构 > Shell

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

2015-03-10 22:55 330 查看
使用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使用密钥登录


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: