hosts.allow - permission denied
Hi all,
After I type sshd: 192.168.1.11 : allow and sshd : ALL : Deny I can't access hosts.allow or deny any more. It says "Permission denied" Before I typed that, I can access hosts.allow and deny. What to do now? Please help... Thanks a lot. By the way, I was wondering what command to edit hosts.allow. For example, I want to put sshd: xxx.xxx.xxx.xxx : allow in that file. Again, thanks.... |
Quote:
You can use any editor like vi, nano etc to edit hosts.allow or hosts.deny file. root# vi /etc/hosts.allow .. Thanks |
Quote:
|
Thanks Vishesh,
Actually, I have two questions. 1. I can't access the hosts.allow anymore (the reason I memtioned above), how to fix it? 2. Although I can't edit(access) hosts.allow for now, I still want to know the command to edit the file. (Thank you for your answer for this question) |
sudo nano hosts.allow
|
so you are on a remot terminal and used ssh . Then told the host.allow file to have "all deny "added to it
1)so you told the remote system to deny ALL connections 2) or at least ALL connections from YOUR ip address "192.168.1.11" if "2" use a different computer on a different network to login and undo what you did if "1" you need to be sitting in front of the computer ,to fix. |
Thanks all,
John VV, I was just wondering how to undo what I did. My purpose is deny all ssh connections, except 192.168.1.11 Thank you |
In hosts.deny:
Quote:
Quote:
|
Hi all,
I already put SSHD: ALL in hosts.deny and SSHD: 192.168.1.11 in hosts.allow But my redhat still allow me remote login.(I did this with another pc) I even disabled ssh service through usr/sbin/setup > system services > unselect sshd I can still login through ssh. Please help, Thank you so much. ps: I did above steps NOT using pc with 192.168.1.11 |
From my notes, has a few additional ssh security functions as well.
/etc/hosts.allow sshd: xxx.xxx.xxx.xxx/255.255.255.0 #Network Adress sshd: xxx.xxx.xxx.xxx #Single IP Address /etc/hosts.deny sshd: ALL sshd1: ALL sshd2: ALL sshdfwd-X11: ALL |
Try these steps:
vim /etc/hosts.deny sshd: ALL EXCEPT 192.168.1.11 |
My hosts.deny:
Code:
ALL: ALL My hosts.allow Code:
ALL: 127.0.0.1 vsftpd and sshd from one machine only Wonder if the contents of the file is not case-sensitive ? |
Thanks you guys
The weird thing is I even disabled the sshd service as I said above ( usr/sbin/setup > system services > unselect sshd) Why I can still apply remote control through "putty" (ssh)? Thank you |
I don't know how sshd is started on your system. Might be that the disabling (as you did) only takes effect at boot and that you still have to stop the ssh daemon manually.
I might have missed it, but which distro are you using? |
Thanks Wim Sturkenboom
I'm using Redhat 7.0 |
All times are GMT -5. The time now is 05:48 AM. |