New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
During installation, my IP is immediately blacklisted, which cuts my connection #128
Comments
|
That's a first I've heard of that bug. I would think that it would mean that your ip was marked as spam either by your system, or by our sync server at some point. That isn't normal behavior, but I also haven't been involved in the project until version 3.x. Right now we don't have a deb package available for the latest Distros. I'm currently in progress of getting control of the PyPi repo, which will allow us to have users install using python's pip module. After that I get the PyPi version updated, I can look at getting access to DenyHosts major repo's to get the package updated properly within their respective repos. If you don't mind me asking what is your ip address. I can check to see if it's on any of my boxes as a blocked ip address. I have a custom plugin that records all blocked ip addresses into a different system for graphing and tracking within the company I work for. |
|
I discover the backstage of DenyHosts then, I wonder, is there really a synchronization somewhere, during the installation? In my case, my hosts.deny file is almost empty, during the installation, only 3 ip are added in a few minutes, including mine. I have encountered this problem in the past already, on Debian. I just wrote a tutorial in French, to install Denyhosts from debian, in the right way, that is, by filling in the white list before even installing the package. Then, I propose the VPN solution, to reconnect if we were kicked out, to delete the IP address from hosts.deny and Iptables also, because, I was added 3 times in Iptables, probably because I was then already in hosts.deny. This is probably a problem in the Denyhosts version of debian, in SID version, which is less advanced than the version on Github. I have not yet tested if my method works, first creating a hosts.allow file but I will do it on a second server on which I will install DenyHosts. I want you to tell me if my IP would be blacklisted, but, this is my public home IP, I don't think it will be blocked. Here's my GPG key if you could email me? Here is the tutorial in French that I wrote for the installation of DenyHosts 2.10 on Debian Buster: https://wiki.visionduweb.fr/index.php?title=Sommaire_S%C3%A9curit%C3%A9#Installer_le_paquet_DenyHosts |
|
If I enter hosts.allow with my IP address before installing DenyHosts, then I am not banned during a new test on my second server. On the other hand, I think that it is nevertheless a serious problem to be taken into consideration. Logically, if DenyHosts is installed, the person installing it should not be immediately ejected. Logically, the person installing is an authorized administrator. Logically, the installation takes place from a legitimate location, in any case, legitimizes the time of the installation, therefore, it is not normal for the administrator to be ejected. I have no opinion on the resolution, but, I wanted to share this experience which seemed to me not to be normal. |
|
I was just talking to my boss about this project, and he mentioned about having the current ip whitelisted to prevent it from being locked out. Pretty much the issue you're having. I'll get this added to the roadmap, I'm just not sure why your ip is being blocked right off. Have you tried installing the GitHub version on your system? Any time I've been installing denyhosts, I've just been using the GitHub version. |
|
If you want to use a deb file to do your install, I built the rpm and deb packages and put it into the releases section. https://github.com/denyhosts/denyhosts/releases/tag/v3.1 |
|
No I used the version of Debian SID. A colleague from Debian told me, the problem is between the chair and the keyboard, because you have to enter the IP address in the white list, then install DenyHosts. I do not think it is normal to do so, or else the instructions for use should mention it more clearly. Most of the tutorials I have read have not talked about this. Me, as a new user, I find it cumbersome to then have to use a VPN to re-enter the system, to remove the file hosts.deny and to add to hosts.allow. In addition, it was not enough, I had to redo it 3 can be even 4 times, and also remove myself from iptables, which had added me several times (3 times). That done, I was supposed to be good, and, I was blocked again. I had to start over again. After removing myself from blacklists and Iptables, I restarted denyhosts. Now it looks good to me, I can log in normally, with the denyhosts version of Debian SID. The good way for install DenyHosts with the .deb from Debian SID : |
|
Ok for the last deb, i add it to my wiki : https://wiki.visionduweb.fr/index.php?title=Sommaire_S%C3%A9curit%C3%A9#Installer_DenyHosts_depuis_le_d.C3.A9p.C3.B4t_officiel_sur_Github |
|
I do agree that whitelisting the current ip should be part of the project I looked over your wiki. Should this section be updated to not use DenyHosts 2.10, since it's outdated? |
|
Yes and no, because, we are talking about the Debian SID repository here, since in the stable Debian Buster repository, DenyHosts is not present. The only reference to DenyHosts, from the Debian project, seems to refer to the SID version, which is effectively obsolete. https://packages.debian.org/fr/sid/denyhosts So I still presented the installation of DenyHosts using the Debian SID repository, to stick to the distribution. In the next step, I propose to install DenyHosts from Github, and, I added the link to the repository of the .deb file that you proposed to me. |
|
Can you test this code out on your box? It's working on my local machine to return the ipv4 address. I just want to verify it would work for you as well. Also, I'm not finding your ip address in my banned list, so I'm not sure why Denyhosts 2.10 is banning you. I did see that there were a bunch of bugs according to Debian that needed to be resolved. So, I'll work on getting their bugs put into here, and then writing Unit Tests to resolve the bugs they had issues with. I'm not sure I'll be able to get Denyhosts added though, since they feel it's competing with Fail2Ban. |
With shell bash Then, this ip need to be added in hosts.allow In my opinion, this should be done during the installation of Denyhosts, automatically, because, the administrator is normally performing its installation from a coherent place, in any case, coherent at the time of installation. Is it more advisable to take the risk of firing the administrator of his server during the installation, or to ask him to check the hosts.allow file AFTER the installation? Constraining the configuration of hosts.allow BEFORE installation does not seem to me to be the right approach. |
|
I agree that it should be done during the setup. Part of the reason I sent you the code I did to help validate that it would pull your public IP. I saw that you ran it in bash, but the code I sent should've been run in python |
I think it's not good. |
Use sudo -E then this script work with sudo and i can see my IP from my box ( ip public ). Return the good ip ( IP client SSH ) sudo python ip.py # Not Work and write : |
|
Unfortunately that wouldn't work for everyone, since services such as AWS don't disclose the public IP on the box itself. They only display the private address space. |
|
Another solution would be to pause the installation, and ask the user to add himself to the whitelist before continuing? |
|
That might be the better solution. Have the whitelist file created and prompt the user to add their ip to the file, and not allow the program to start until the file has one ip address in it. |
|
With debian I discovered that the hosts.allow file exists by default. Optionally, offer input directly from the prompt, during installation. |
|
@ZerooCool Can you give the branch bug_128 a whirl? I tested it out on my end, and it's populating the allowed_hosts file. I load existing entries in the allowed_hosts file using the AllowedHosts class. Then I give the option to query 6 different sites to check what the public ip is. Then I ask for a comma-delimited list of ips to add to the list. The returned ip(s) are then written to the allowed_hosts file, and it's output what ip addresses are added to the allowed_hosts file This is working for me to automatically detect the public on my home computer along with on AWS and Rackspace boxes. |
|
I look ASAP. |
|
With .deb 3.1.2-2 and Debian Buster new VPS from LWS, for test : From git clone from the branch bug_128 , look this issue #143 |
|
@ZerooCool this bug looks to be resolved. Can you verify and close it, if it is? |
|
I have test the bug_128 and, this command : But : Add auto my IP not work for me. When i install : 0 IP was added in hosts.allow |
|
The requirements install should be |
|
I up the debian documentation for this command. But, the same message if i want enable : Another problem, on the master branch, I don't know why I encountered this problem. Finally, you understood, here, I tried to install the master version, on a virtual machine. |
|
Ok, i have make a second test, with the master branch, and my documentation. Next, i test the same installation with bug_128 |
|
New test for the branch bug_128 from a VM with VirtualBox Outch, not work ! |
|
Branch but_128 - Resolved Please Read, adapt the information message for entering ip addresses. I have test with the server VPS from LWS. 31.207.38.105 But, the first IP 31.207.38.105 is the Server IP, then, is it really necessary to add it ? For my part, I have no need for the first step for IP, it is up to you to see if it is really necessary. Perfect ! I don"t have use this method : I have only use the second possibility, then, i don't have add daemon in /etc/init.d Branch but_128 - Resolved |
I think it's fine to prevent the server from blocking itself out. |
|
Ok, for me, the update can be done. If you can summarize this in good English, and include it when proposing to enter our additional IP address, we will better understand what is going on, and why the step is important. Can also be explained that it is necessary to use the public IP address of the client, of the internet box, in the case of a connection to a remote server. I think that if any good administrator can do it, mentioning it correctly is not a bad idea. I'll let you close the issue when you've applied the fix. |
Hello,
Can you tell me why Denyhosts is not available in stable on Debian Buster ?
I installed the SID version.
It seems to work.
It works so well, that during installation, my IP is immediately blacklisted, which cuts my connection.
I had to go through a VPN. I managed to reconnect. I was able to remove my blacklisted IP address, to put it in the whitelist.
Is this behavior normal?
Would i have done wrong?
Should I have created deny.allow first and added my IP address, and only then installed DenyHosts?
The text was updated successfully, but these errors were encountered: