#*/1 * * * * sh /root/check.sh
SSH_PORT=`netstat -antp | grep sshd| awk -F ":" '{print $4}' | awk '{if($0 !~/^$/)print $0}'`
if [ 22 = $SSH_PORT ]; then
echo "change ssh port"
cp -f /root/sshd_config /etc/ssh/
/sbin/service sshd restart
fi
#*/1 * * * * sh /root/check.sh
SSH_PORT=`netstat -antp | grep sshd| awk -F ":" '{print $4}' | awk '{if($0 !~/^$/)print $0}'`
if [ 22 = $SSH_PORT ]; then
echo "change ssh port"
cp -f /root/sshd_config /etc/ssh/
/sbin/service sshd restart
fi