{"id":1252,"date":"2015-04-10T13:12:07","date_gmt":"2015-04-10T13:12:07","guid":{"rendered":"http:\/\/linux.uits.uconn.edu\/gms02004\/?p=139"},"modified":"2015-04-10T13:12:07","modified_gmt":"2015-04-10T13:12:07","slug":"denyhosts-assists-2","status":"publish","type":"post","link":"https:\/\/technicalknow-how.com\/wp\/denyhosts-assists-2\/","title":{"rendered":"Denyhosts Assists"},"content":{"rendered":"<p>Every so often a legitimate user will get blocked by deny hosts. \u00a0When this happens you can re-enable their access with these 8 simple steps (<strong>UPDATE<\/strong>: or use the faster version, see below):<\/p>\n<ol>\n<li>Stop DenyHosts\n<pre><code># service denyhosts stop<\/code><\/pre>\n<\/li>\n<li>Remove the IP address from <code>\/etc\/hosts.deny<\/code><\/li>\n<li>Edit <code>\/var\/lib\/denyhosts\/hosts<\/code> and remove the lines containing the IP address.<\/li>\n<li>Edit <code>\/var\/lib\/denyhosts\/hosts-restricted<\/code> and remove the lines containing the IP address.<\/li>\n<li>Edit <code>\/var\/lib\/denyhosts\/hosts-root<\/code> and remove the lines containing the IP address.<\/li>\n<li>Edit <code>\/var\/lib\/denyhosts\/hosts-valid<\/code> and remove the lines containing the IP address.<\/li>\n<li>Edit <code>\/var\/lib\/denyhosts\/users-hosts<\/code> and remove the lines containing the IP address.<\/li>\n<li>Consider adding the IP address to \/etc\/hosts.allow\n<pre><code>sshd:  IP_Address<\/code><\/pre>\n<\/li>\n<li>Start DenyHosts\n<pre><code># service denyhosts start<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>That&#8217;s it, your user should be able to access the server again.<\/p>\n<p>The above process was a bit tedious however I am leaving it there because it gives details about what files are involved. \u00a0Since doing the above is time consuming here is what I have been doing that is much easier:<\/p>\n<ol>\n<li>Stop DenyHosts\n<pre><code># service denyhosts stop<\/code><\/pre>\n<\/li>\n<li>Remove the IP address from\u00a0<code>\/etc\/hosts.deny<\/code>\n<ol>\n<li>\n<pre># sed -i '\/IP_ADDRESS\/d' \/etc\/hosts.deny<\/pre>\n<\/li>\n<\/ol>\n<\/li>\n<li>Remove all entries found under <code>\/var\/lib\/denyhosts\/<\/code>\u00a0containing the IP address.\n<ol>\n<li>\n<pre># cd \/var\/lib\/denyhosts\n# for i in *hosts*;do sed -i '\/IP_ADDRESS\/d' \"$i\";done<\/pre>\n<\/li>\n<\/ol>\n<\/li>\n<li>Consider adding the IP address to \/etc\/hosts.allow\n<pre style=\"font-style: inherit\"><code>sshd:  IP_Address<\/code><\/pre>\n<\/li>\n<li>Start DenyHosts\n<pre style=\"font-style: inherit\"><code># service denyhosts start<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every so often a legitimate user will get blocked by deny hosts. \u00a0When this happens you can re-enable their access with these 8 simple steps (UPDATE: or use the faster version, see below): Stop DenyHosts # service denyhosts stop Remove the IP address from \/etc\/hosts.deny Edit \/var\/lib\/denyhosts\/hosts and remove the lines containing the IP address. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"wds_primary_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[18,148],"tags":[206,13,96,186,141],"class_list":["post-1252","post","type-post","status-publish","format-standard","hentry","category-security","category-system-administration","tag-denyhosts","tag-linux","tag-security","tag-ssh","tag-system-administration"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3749z-kc","_links":{"self":[{"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/posts\/1252"}],"collection":[{"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/comments?post=1252"}],"version-history":[{"count":0,"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/posts\/1252\/revisions"}],"wp:attachment":[{"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/media?parent=1252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/categories?post=1252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/technicalknow-how.com\/wp\/wp-json\/wp\/v2\/tags?post=1252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}