编辑ssh配置文件

1
sudo vim /etc/ssh/sshd_config

内容

Port 6000

重新启动 ssh 服务

1
sudo systemctl restart sshd

更新防火墙规则

1
sudo iptables -A INPUT -p tcp --dport 6000 -j ACCEPT

或者

1
sudo ufw allow 6000/tcp