Tuesday, May 14, 2024
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 5327  / 2 Years ago, mon, may 2, 2022, 9:43:30

As I use SSH, I would like to get the denyhosts that I read about here, but when using the command:



sudo apt-get install denyhosts


To install it, I got this error:



Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package denyhosts


So is this package no longer available then? Or is it just under a different name or something? If this package is no longer available on the main Ubuntu repositories, is there anywhere else from which I can get it?



OS Information:



Description:    Ubuntu 14.10
Release: 14.10

More From » software-installation

 Answers
7

Denyhosts is no longer available. You can use fail2ban or better, a few ssh tips.




  1. Use ssh keys and disable password authentication.


  2. iptables can do essentially the same thing as denyhosts and fail2ban . The advantage is no additional packages are required.



    iptables -A INPUT -p tcp -m tcp --dport 22 -m tcp -m state --state NEW -m recent --set --name SSH --rsource

    iptables -A INPUT -p tcp -m tcp --dport 22 -m recent --update --seconds 600 --hitcount 8 --rttl --name SSH --rsource -j REJECT --reject-with icmp-host-prohibited

    iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT



See:



http://bodhizazen.com/Tutorials/SSH_security



http://bodhizazen.com/Tutorials/iptables#Additional_Tips



On the second link, scroll down a bit. You will need to save and restore your iptables rules.


[#21083] Tuesday, May 3, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
utonmbo

Total Points: 134
Total Questions: 104
Total Answers: 118

Location: Argentina
Member since Mon, Jan 3, 2022
2 Years ago
;