vps交流

SSH 默认端口非 22,开启 Firewalld 后失联


忘了到 /usr/lib/firewalld/services/ssh.xml 修改端口了

除了重装还有救吗?

难道不是进VNC?
你自己搞自己了,通过webshell上去看看吧
有VNC的话就有救

菜单 发表于 2022-5-20 17:36
难道不是进VNC?

把 VNC 忘了,救回来了,谢谢大佬

不要搞我呀 发表于 2022-5-20 17:46
把 VNC 忘了,救回来了,谢谢大佬

你的名字很不错

你应该在开机命令 /etc/rc.local 加上禁用防火墙的命令

RHEL/CENTOS
systemctl disable –now firewalld

Ubuntu/Deblian
systemctl disable –now firewalld

iptables
The IPv4 and IPv6 syntax is as follows:

# Accept all traffic first to avoid ssh lockdown  via iptables firewall rules #
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

# Flush All Iptables Chains/Firewall rules #
iptables -F

# Delete all Iptables Chains #
iptables -X

# Flush all counters too #
iptables -Z
# Flush and delete all nat and  mangle #
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -t raw -F
iptables -t raw -X