I am trying to unblock an IP from which I was doing some tests. I have followed the tutorials on the net:
$ sudo /etc/init.d/denyhosts stop
$ sudo vim /etc/deny.
Ubuntu 18.04
IP_UNBLOCK='1.2.3.4'
systemctl stop denyhosts
sed -i -e "/$IP_UNBLOCK/d" /etc/hosts.deny
sed -i -e "/^$IP_UNBLOCK/d" /var/lib/denyhosts/hosts
sed -i -e "/^$IP_UNBLOCK/d" /var/lib/denyhosts/hosts-restricted
sed -i -e "/^$IP_UNBLOCK/d" /var/lib/denyhosts/hosts-root
sed -i -e "/^$IP_UNBLOCK/d" /var/lib/denyhosts/hosts-valid
sed -i -e "/$IP_UNBLOCK/d" /var/lib/denyhosts/users-hosts
sed -i -e "/^$IP_UNBLOCK/d" /var/lib/denyhosts/hosts-root
sed -i -e "/refused connect from $IP_UNBLOCK/d" /var/log/auth.log
sed -i -e "/from $IP_UNBLOCK port/d" /var/log/auth.log
iptables -D INPUT -s "$IP_UNBLOCK" -j DROP
ufw reload
systemctl start denyhosts
and run this before you install denyhosts
echo "All:" $(last -i | grep -v '0.0.0.0' | grep 'root' | head -1 | awk '{print $3}') >> /etc/hosts.allow