Hi,

I have this script I found on the list, modified a bit to make it work, and it 
seems to delete almost all of my denyhosts entries, even though I only specified
one ip.

This is what it looks like:

#!/bin/bash  

# Denyhosts is stopped elsewhere before running this script.
# 
cd /usr/share/denyhosts/data
sed "/.*$1.*/d" <users-hosts >users-hosts 
sed "/$1.*/d" <hosts >hosts 
sed "/$1.*/d" <hosts-valid >hosts-valid 
sed "/$1.*/d" <hosts-root >hosts-root 
sed "/$1.*/d" <hosts-restricted >hosts-restricted 
cd /etc 
sed "/^sshd: $1/d" <hosts.deny >hosts.deny
# 
# Denyhosts is started elsewhere after running this script.

I run it like ./unban 1.2.3.4 and it seems to remove almost all of my records.

I say this because I had over 10000 entries in my hosts.deny, according to wc, 
and now:

  736  1472 14848

That's a big drop, for only unbanning one ip.

I also noticed that my hosts file in /usr/share/denyhosts/data now only has 7 
records in it, quite a change.

I hope someone can help to correct this script.

Thanks, 

-Michael

AI5HF

P.S.
Have you learned the secret?
Leverage Your Efforts With ViralURL.com!
http://viralurl.com/mtgames

http://mtgames.org/
Http://ai5hf.mtgames.org/
http://moo.mtgames.org/
"A world that contained something as amazing as that bumblebee was a world in 
which he wanted to live." -- Christopher Paolini, Brisingr
"The songs of the dead are the lamentations of the living." -- Christopher 
Paolini, Eldest
skype: lilmike2
msn: [email protected]
gmail: [email protected]

pc details:
Intel quad core q6700-2.66 GHz; 4 gb ddr2 duel channel ram; 500 gb harddrive; 
windows xp pro.
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Denyhosts-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/denyhosts-user

Reply via email to