1. 修改ssh配置文件 vim /etc/ssh/sshd_config 找到或者加上一行 Port {num} 比如 Port 23456 2. 重启服务 service sshd restart 或者 systemctl restart sshd.service