Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ssh localhost and sshd_config listen address
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
huuan
Apprentice
Apprentice


Joined: 19 Feb 2007
Posts: 265
Location: California

PostPosted: Sun Oct 27, 2013 9:27 am    Post subject: ssh localhost and sshd_config listen address Reply with quote

In case someone else has this issue. Just spent way too many hours debugging why the sftp plugin for wordpress had stopped working after server upgrade 32bit-->64bit.
Was getting connection refused.
Found I could SSH into the box externally but not via localhost even with the firewall disabled.
Tried NMAP from external and I could see the SSH port open but found from localhost it was closed.
Turns out that it was a weird DNS related problem.

The box in question has a legacy original name like xxtest but is now always referred to like xx. Both xx and xxtest are in DNS but xxtest is the primary name and xx an alias.
In /etc/hosts it had
127.0.0.1 xx.domain.tld xx localhost

Found that NMAP locally to xxtest showed the SSH port open but NMAP locally to xx or localhost showed it closed.
NMAP externally to both xx and xxtest showed the SSH port open. Weird.

The solution was to add the line
ListenAddress 127.0.0.1
to /etc/ssh/sshd_config

had been working on the old system, also gentoo, for years without that line. No clue what changed to cause that.
Hope this helps someone.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum