You are not logged in.

#1 2006-08-06 14:07:51

ubermartian
Member
From: Edinburgh
Registered: 2004-02-06
Posts: 32

SSH problem (hostname related?) [solved]

Hi,

sshd on my server won't allow me to log in from my desktop (linux or windows, both use 192.168.1.2 as IP), however other machines with different IPs can gain access.

I've added the name of the desktop to the servers hosts file

192.168.1.2 nightshade.localdomain nightshade

and have a feeling this is causing the problem.  Is there any way to fix so that I don't have to re-edit the hosts file as I'm finding this useful elsewhere?

Offline

#2 2006-08-06 14:23:55

bigbob73
Member
From: Fort Worth, Texas
Registered: 2006-07-19
Posts: 89

Re: SSH problem (hostname related?) [solved]

ubermartian wrote:

Hi,

sshd on my server won't allow me to log in from my desktop (linux or windows, both use 192.168.1.2 as IP), however other machines with different IPs can gain access.

I've added the name of the desktop to the servers hosts file

192.168.1.2 nightshade.localdomain nightshade

and have a feeling this is causing the problem.  Is there any way to fix so that I don't have to re-edit the hosts file as I'm finding this useful elsewhere?

check hosts.allow and hosts.deny
hosts.allow -
sshd: ALL

hosts.deny -
ALL: ALL: DENY

Offline

#3 2006-08-06 14:44:52

ubermartian
Member
From: Edinburgh
Registered: 2004-02-06
Posts: 32

Re: SSH problem (hostname related?) [solved]

Sorry, I should have posted.  The host.(allow/deny) files are fine, first thing I checked.

Offline

#4 2006-08-06 15:07:29

bigbob73
Member
From: Fort Worth, Texas
Registered: 2006-07-19
Posts: 89

Re: SSH problem (hostname related?) [solved]

ubermartian wrote:

Sorry, I should have posted.  The host.(allow/deny) files are fine, first thing I checked.

no problem, could you post your sshd_config?

Offline

#5 2006-08-06 15:15:34

ubermartian
Member
From: Edinburgh
Registered: 2004-02-06
Posts: 32

Re: SSH problem (hostname related?) [solved]

Protocol 2

ListenAddress 0.0.0.0

PermitRootLogin no

AllowGroups wheel
AllowUsers XXXXX XXXXXX
PermitEmptyPasswords no

UsePAM yes

Banner /var/local/sshbanner

# override default of no subsystems
Subsystem    sftp    /usr/lib/ssh/sftp-server

I'm convinced it's adding the name of the desktop to the servers hosts file thats caused this.  If I change the desktop's IP I can log in from the desktop, and if I comment out the offending line in the hosts file, I can login with the IP address.

Offline

#6 2006-08-06 16:27:01

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: SSH problem (hostname related?) [solved]

What if you just set

192.168.1.2 nightshade

in /etc/hosts?

Offline

#7 2006-08-06 17:18:10

ubermartian
Member
From: Edinburgh
Registered: 2004-02-06
Posts: 32

Re: SSH problem (hostname related?) [solved]

When I had another look at the /etc/hosts file, using a different text editor to vim, there was a load of garbage appended on to the end of the nightshade line.  Vim didn't display this for some reason.  It was the server name and IP address repeated over and over again. Removing this solved the problem.

Offline

#8 2006-08-06 18:37:18

bigbob73
Member
From: Fort Worth, Texas
Registered: 2006-07-19
Posts: 89

Re: SSH problem (hostname related?) [solved]

ubermartian wrote:

When I had another look at the /etc/hosts file, using a different text editor to vim, there was a load of garbage appended on to the end of the nightshade line.  Vim didn't display this for some reason.  It was the server name and IP address repeated over and over again. Removing this solved the problem.

glad that fixed it!  you may want to add (solved) to the end of your subject line.  wink

Offline

Board footer

Powered by FluxBB