The Ubuntu Xenial sshguard
package creates a sshguard
firewall chain for both iptables
and ip6tables
(see file /usr/lib/sshguard/firewall
if interested by details). So if you look into them you should find a rule banning your IP: use iptables -L -n -v sshguard
. (I suppose from now on you are speaking about an IPv4 address, if it is IPv6 please replace iptables
by ip6tables
everywhere).
Then you either flush the chain completely, which would remove the ban for all IPs, yours and others, with iptables -F sshguard
.
Or if you want to remove just your IP, you need first to redo the previous command with --line-numbers
to find which number is the rule related to your IP and then you can do iptables -D sshguard NUM
replacing NUM
by the rule number as observed above.
That should then restore ssh access from the IP. No need to restart anything, firewall rules should be applied in real time, so your flush or deletion will be effective immediately.
Also you have an /etc/sshguard/whitelist
file where you could add your IP, if it is a fixed one, to avoid the same problem in the future.
sshguard
and you will need to remove some that match your IP being blocked.