更改centos默认22端口
#!/bin/bash#更改为10022rs=`cat /etc/ssh/sshd_config | grep 'Port 10022'|wc -l`if [ $rs -eq 0 ];then echo 'Port 10022' >> /etc/ssh/sshd_configelse sed -i -e "s/Port 10022.*/Port 10022/g" /etc/ssh/sshd_configfi#强烈建议分段执行#取消 22sed -i