Forum Moderators: phranque

Message Too Old, No Replies

Please help! Many thanks!

Problem with SSH access to my server

         

weble

4:59 pm on Dec 4, 2005 (gmt 0)

10+ Year Member



Hi Friend,

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

encyclo

1:58 am on Dec 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As you cannot ssh in, unless you have another method to interact with the server (cPanel, telnetd...) there is nothing left other than to as for your tech support to access the machine physically and edit the hosts.allow file, or drive over to the datacenter yourself.

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. ;)

physics

2:48 pm on Dec 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry to hear about that! Just ask tech support to put a 'standard' hosts file in there so you can log in.