sshd deny ip

2021-08-20

#DenyUsers *@172.16.30.88
#DenyUsers *@192.168.169.134

cat add_sshd_deny_ip.sh
#!/bin/sh

if [ -z $1 ];then
echo Usage $0 ip
exit 0;
fi

IP=$1

file=/etc/ssh/sshd_config
#sed -i '/${IP}/d' $file
echo "DenyUsers *@${IP}" >> $file
systemctl restart sshd
tail -5 $file

分类:Linux | 标签: |

相关日志

评论被关闭!