Xshell用密钥连接远程Linux

1.首先下载一个XSHELL,我这里用的是Xshell_5.0,以下几个是要配置的地方


2.在TOOLS 下面生成新的密钥文件




3、复制生成的公钥到远程linux里面 /root/.ssh/authorized_keys 文件中。如果没有.ssh目录,需要自己建立一个,并更改目录权限为700
[root@localhost ~]# mkdir /root/.ssh
[root@localhost ~]# chmod 700 /root/.ssh/
[root@localhost ~]# vi /root/.ssh/authorized_keys

粘贴公钥的内容,保存退出。


4、关闭远程linux防火墙,永久关闭selinux
 #vi /etc/selinux/config        #修改selinux的配置文件
更改“SELINUX=enforcing”为 SELINUX=disabled  保存退出。
[root@localhost ~]# /usr/sbin/sestatus -v        #查看selinux的状态命令
SELinux status:                disabled
关闭防火墙
[root@localhost ~]# iptables -F                               #清空防火墙配置
[root@localhost ~]# /etc/init.d/iptables save          #清空防火墙配置后,记得保存

iptables:将防火墙规则保存到 /etc/sysconfig/iptables:    [确定]


5.通过日志也可以查看成功的信息


猜你喜欢

转载自blog.csdn.net/a1779078902/article/details/80680562