LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   problems with passwordless log in as root with SSH (https://www.linuxquestions.org/questions/linux-software-2/problems-with-passwordless-log-in-as-root-with-ssh-723926/)

Mountain 05-05-2009 02:16 PM

problems with passwordless log in as root with SSH
 
In /etc/ssh/sshd_config if I use this line, passwordless login works as intended:

Code:

# Authentication:
PermitRootLogin yes
AllowUsers root@*

But if I change it to this (which is what I want for better security), the login is not permitted. (It asks for a password, and no root password exists.)
Code:

# Authentication:
PermitRootLogin yes
AllowUsers root@192.168.100.101

The client has this IP address:
Code:

$ ifconfig
eth1      Link encap:Ethernet  HWaddr xxxxxxxxxxxxxx 
          inet addr:192.168.100.101

and eth1 is the active interface.

So why does the login not work when I specify the IP address that is allowed, but it does work when I open it up to any IP addresses?

How would you trouble shoot this? Which log should I look in to find the IP address that is attempting to log in?

Mountain 05-05-2009 02:28 PM

I discovered auth.log. It showed me the clues I needed.

The hosts file on the ssh server has an entry like this:

Code:

192.168.100.101        myclient.asdf.xx.my_isp.org        myclient
I had tried both the IP address and the short host name. But I saw in auth.log that the access denial was listing my fully qualified host name.

So I changed /etc/ssh/sshd_config to this:
Code:

AllowUsers root@myclient.asdf.xx.my_isp.org
Now it works.


All times are GMT -5. The time now is 10:53 PM.