基本操作
查看状态
systemctl status sshd.service
启动服务
systemctl start sshd.service
重启服务
systemctl restart sshd.service
开机自启
systemctl enable sshd.service
查看和修改SSH占用端口
sudo netstat -atlunp | grep sshd
在SSH的配置文件中修改相关信息
vim /etc/ssh/ssh_config
修改ssh_config 指定端口,并重启生效
port=指定的端口
systemctl restart ssh.service