1234567
# Ubuntu 18.04sudo vi /etc/ssh/sshd_config#Port 22#Port 12345sudo systemctl restart sshd
如有需要还要设置服务器端防火墙放行设置的端口
客户端配置
123456
# ~/.ssh/configHost abc Hostname 1.2.3.4 Port 12345 User ubuntu