1、“新安装的部件,一般都是安全加固后的,去安全加固,在其他机器上可以用root登录 ”的方法:
可以严格按照去安全加固的方法操作(参考75、76),也可以用最简单的方法:
/usr/lib/systemd/system/sshd.service
禁掉下面的行:ExecStart=/usr/local/openssh-7.4p1/sbin/sshd -D $OPTIONS
放开上面的行:ExecStart=/usr/sbin/sshd -D $OPTIONS
/etc/ssh/sshd_config文件中:放开22端口,开启root访问权限:
PermitRootLogin yes这行放开就好;
reboot后,
其他ssh: connect to host 10.1.245.106 port 22: No route to host
/etc/ssh/sshd_config问价那种22和22022的端口都已经放开了,为什么还会报这个错呢?
service iptables status
关闭
service iptables stop
查看防火墙开机启动状态
chkconfig iptables --list
关闭开机启动
chkconfig iptables off
可以严格按照去安全加固的方法操作(参考75、76),也可以用最简单的方法:
/usr/lib/systemd/system/sshd.service
禁掉下面的行:ExecStart=/usr/local/openssh-7.4p1/sbin/sshd -D $OPTIONS
放开上面的行:ExecStart=/usr/sbin/sshd -D $OPTIONS
/etc/ssh/sshd_config文件中:放开22端口,开启root访问权限:
PermitRootLogin yes这行放开就好;
reboot后,
其他ssh: connect to host 10.1.245.106 port 22: No route to host
/etc/ssh/sshd_config问价那种22和22022的端口都已经放开了,为什么还会报这个错呢?
原因是:被访问主机开启了防火墙,将防火墙停掉后,就可以了:
service iptables status
关闭
service iptables stop
查看防火墙开机启动状态
chkconfig iptables --list
关闭开机启动
chkconfig iptables off