Reset/Unblock/Unban ssh IP ban by denyhosts (openSuse 13.1)
March 2016
Problem description:
- Too many bad ssh login attempts got me banned by hostdeny deamon/service.
- I can still access your computer from console or different IP as a backup.
Background Information:
- This information is based on openSuse 13.1 although it may be generally applicable
to other distributions or versions.
- denyhosts 2.6-7.1 installed from OBS network:utilities repository which can be added from
http://download.opensuse.org/repositories/network:/utilities/openSUSE_13.1
- Configuration for denyhost lives in: /etc/denyhosts.conf
log file is located in location: DAEMON_LOG = /var/log/denyhosts
banned host database location: WORK_DIR = /var/lib/denyhosts
- Init daemon in 13.1 is Systemd. If you use init please use /etc/init.d/denyhosts
to start/stop the service.
Solution used:
- Login to your computer either from the console or different IP address.
- Check the log file (as per DAEMON_LOG) for your host being denied:
grep 'new denied hosts' /var/log/denyhosts | less
Search for the date and time or IP to verify that you are actually banned.
- Stop denyhosts service and verify that it is stopped:
systemctl status denyhosts.service
systemctl stop denyhosts.service
systemctl status denyhosts.service
- Remove your banned host (as per WORK_DIR) from /var/lib/denyhosts/hosts
Make sure to remove your host by IP and also by name. The name and IP should
be following lines.
- Remove your banned host from /etc/hosts.deny
Make sure to remove your host by IP and also by name, including preceding
comment lines. The name and IP should be following lines.
- Try to login from previously banned IP. It should now work.
- Start denyhosts service:
systemctl stop denyhosts.service
systemctl status denyhosts.service
- Try to login from previously banned IP. It should now work.
Links: