本文以centos系统为例:
1、关闭防火墙和selinux
#关闭防火墙
#centos 7
systemctl stop firewalld
#centos 6
service iptables stop
#关闭selinux
vi /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled
2、修改sshd_config文件
#Port修改为目标端口,如:2233
vi /etc./ssh/sshd_config
3、重启sshd和查看状态
#1、重启ssh
#centos 7
systemctl restart sshd.service
#centos 6
service sshd restart
#2、查看sshd状态
#centos 7
systemctl status sshd.service
#centos 6
service sshd status
控制台显示:Active: active (running) 和 Server listening on port 2233 ,即表示修改成功