Forum Moderators: phranque
I cannot SSH into my server now. I guess it is wrong /etc/hosts.allow setting that blocks me to ssh into my server.
Yesterday I was able to log on server by SSH and I made some modications under /etc/hosts.allow, and I added the following lines:
sshd : localhost : allow
sshd : friendlycomputer : allow
sshd : all : deny
After that, I cannot SSH into the server again. Now I feel the line with "friendlycomputer" have mistake. "friendlycomputer" should be the IP address of my PC that I usually login the server remotely from.
As I cannot SSH into server, how can I fix the problem now?
Please help!
Thank you very much from my heart!
David
As to the problem, IIRC the wildcard "ALL" always matches so
sshd : all : deny is denying access to everything. You need to combine hosts.deny and hosts.allow - in hosts.deny you should have the basic: ALL: ALL and in hosts.allow you can allow your friendly computer. See
man hosts_access for more info, and test the syntax on a machine on your local network first to avoid any more accidents. ;)