出于安全原因,我将 ssh 登录的端口更改为不同的号码。但是,一旦我这样做并尝试重新连接,我就会收到“连接超时错误”。 一旦我切换回端口 22,一切正常。
ssh [email protected]
登录到我的VPS。sudo systemctl restart sshd
systemctl status sshd
ssh: connect to host vps.ip.address port 22: Connection refused
ssh [email protected] -p 717
ssh: connect to vps.ip.address port 717: Connection timed out
sudo grep Port /etc/ssh/sshd_config
。输出是:Port 717
#GatewayPorts no
sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Mar 13 08:18:20 localhost sshd[4883]: Server listening on 0.0.0.0 port 717.`
`Mar 13 08:18:20 localhost polkitd(authority=local): Unregistered Authentication Agent for unix-process:4863:4345392 (system bus name :1.35, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)