Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can DenyHosts purge old entries added to the HOSTS_DENY file?

0
Posted

Can DenyHosts purge old entries added to the HOSTS_DENY file?

0

DenyHosts v0.8.0 (and greater) offers the ability to remove old entries from the HOSTS_DENY file (eg. /etc/hosts.deny). You must set the PURGE_DENY parameter in your configuration file and invoke DenyHosts with the –purge command line flag: $ denyhosts.py –purge When DenyHosts is run with the –purge flag it locates entries in the HOSTS_DENY file that have been previously timestamped by DenyHosts that have exceeed the PURGE_DENY value using the following algorithm: • HOSTS_DENY is backed up to a file named HOSTS_DENY.purge.bak • a temp file is created, HOSTS_DENY.purge.tmp • the HOSTS_DENY is parsed and each non-expired entry and each non-timestamped entry will be written to HOSTS_DENY.purge.tmp • each HOSTS_DENY that has expired (based on PURGE_DENY) will not be written to HOSTS_DENY.purge.tmp • after all lines are parsed, if atleast one entry was not written to HOSTS_DENY.purge.tmp (that is, no entries were expired) then HOSTS_DENY.purge.tmp will be deleted and no further processin

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.