{"action":"created","issue":{"url":"https://api.github.com/repos/denyhosts/denyhosts/issues/71","repository_url":"https://api.github.com/repos/denyhosts/denyhosts","labels_url":"https://api.github.com/repos/denyhosts/denyhosts/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/denyhosts/denyhosts/issues/71/comments","events_url":"https://api.github.com/repos/denyhosts/denyhosts/issues/71/events","html_url":"https://github.com/denyhosts/denyhosts/issues/71","id":224338799,"number":71,"title":"Add Easier Ban Clearing From Denyhosts","user":{"login":"tsgan","id":1160812,"avatar_url":"https://avatars2.githubusercontent.com/u/1160812?v=3","gravatar_id":"","url":"https://api.github.com/users/tsgan","html_url":"https://github.com/tsgan","followers_url":"https://api.github.com/users/tsgan/followers","following_url":"https://api.github.com/users/tsgan/following{/other_user}","gists_url":"https://api.github.com/users/tsgan/gists{/gist_id}","starred_url":"https://api.github.com/users/tsgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tsgan/subscriptions","organizations_url":"https://api.github.com/users/tsgan/orgs","repos_url":"https://api.github.com/users/tsgan/repos","events_url":"https://api.github.com/users/tsgan/events{/privacy}","received_events_url":"https://api.github.com/users/tsgan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-26T04:14:08Z","updated_at":"2017-04-26T13:23:00Z","closed_at":"2017-04-26T13:23:00Z","body":"Clearing an IP seems a tedious manual process, like IP and comments need to be removed from a number of files. Please find attached zip file that has mod_denyhosts script which makes easier to add/remove IP. I would like to include it to official denyhosts repo. Please let me know.\r\nUsage example:\r\n```\r\nroot@bsd1:/home/tsgan # bash mod_denyhosts -H\r\nmod_denyhosts\r\na small script to unblock an IP address and/or hostname from denyhosts.\r\n-h  | --host    | --hostname     : Specify the hostname to unblock (required, unless -nh is added).\r\n-i  | --ip      | --ipaddress    : Specify the IP address to unblock (required, unless -ni is added).\r\n-nh | --no-host | --no-hostname  : Don't require a hostname to start unblocking things.\r\n-ni | --no-ip   | --no-ipaddress : Don't require an IP address to start unblocking things.\r\n-a  | --add     | --add-allow    : Add the specified IP address and/or hostname to the unblock file, thus preventing that the specified IP address and/or hostname get blocked again.\r\n-H  | --help                     : show this help.\r\n\r\nroot@bsd1:/home/tsgan # more /etc/hosts.deniedssh\r\nsshd: 127.0.0.1 : deny\r\nsshd: 192.168.0.100 : deny\r\n\r\nroot@bsd1:/home/tsgan # bash mod_denyhosts -nh -i 192.168.0.100\r\nWARNING: You disabled removing a hostname. Most bans consist of both an IP address and a hostname. Please double check if you want this. Continuing now.\r\nStopping denyhosts.\r\nWaiting for PIDS: 21838.\r\nRemoved ip address 192.168.0.100 from /etc/hosts.deniedssh\r\nRemoved ip address 192.168.0.100 from /usr/local/share/denyhosts/data/hosts\r\nRemoved ip address 192.168.0.100 from /usr/local/share/denyhosts/data/hosts-restricted\r\nRemoved ip address 192.168.0.100 from /usr/local/share/denyhosts/data/hosts-root\r\nRemoved ip address 192.168.0.100 from /usr/local/share/denyhosts/data/hosts-valid\r\nRemoved ip address 192.168.0.100 from /usr/local/share/denyhosts/data/users-hosts\r\nStarting denyhosts.\r\n\r\nroot@bsd1:/home/tsgan # more /etc/hosts.deniedssh\r\nsshd: 127.0.0.1 : deny\r\nroot@bsd1:/home/tsgan #\r\n```\r\n[mod_denyhosts.zip](https://github.com/denyhosts/denyhosts/files/957203/mod_denyhosts.zip)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/denyhosts/denyhosts/issues/comments/297406122","html_url":"https://github.com/denyhosts/denyhosts/issues/71#issuecomment-297406122","issue_url":"https://api.github.com/repos/denyhosts/denyhosts/issues/71","id":297406122,"user":{"login":"slicer69","id":7461921,"avatar_url":"https://avatars1.githubusercontent.com/u/7461921?v=3","gravatar_id":"","url":"https://api.github.com/users/slicer69","html_url":"https://github.com/slicer69","followers_url":"https://api.github.com/users/slicer69/followers","following_url":"https://api.github.com/users/slicer69/following{/other_user}","gists_url":"https://api.github.com/users/slicer69/gists{/gist_id}","starred_url":"https://api.github.com/users/slicer69/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slicer69/subscriptions","organizations_url":"https://api.github.com/users/slicer69/orgs","repos_url":"https://api.github.com/users/slicer69/repos","events_url":"https://api.github.com/users/slicer69/events{/privacy}","received_events_url":"https://api.github.com/users/slicer69/received_events","type":"User","site_admin":false},"created_at":"2017-04-26T13:23:00Z","updated_at":"2017-04-26T13:23:00Z","body":"The bash script looks good and seems to work as intended. I have added it to the DenyHosts \"scripts\" directory and pushed it to our master branch. Thank you for submitting it.\r\n\r\nAs a suggestion: in the future, it might be helpful to extend the script a little to allow it to remove IP/hostnames from the /etc/hosts.deny file and perhaps from the firewall iptables/PF as well."}}
{"actor":{"display_login":"slicer69"}}