Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sshd/bind problem [solved]
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
klatk
n00b
n00b


Joined: 25 Jun 2004
Posts: 35

PostPosted: Wed Sep 14, 2005 7:01 pm    Post subject: sshd/bind problem [solved] Reply with quote

So after a recent reconfigure of my kernel to enable my USB mouse I've been unable to ssh in. After checking my logs I saw this bind error...

Quote:
error: Bind to port 22 on 0.0.0.0 failed: Address already in use.


So my questions now are--

1. What could have happened so that something's already using that address? and how can I find out what that is?

2. Does sshd have to listen to 0.0.0.0 to work? Can it be set to something else with no problems or other change in behavior?

Thanks


Last edited by klatk on Sun Sep 18, 2005 2:52 am; edited 1 time in total
Back to top
View user's profile Send private message
christsong84
Veteran
Veteran


Joined: 06 Apr 2003
Posts: 1003
Location: GMT-8 (Spokane)

PostPosted: Wed Sep 14, 2005 7:29 pm    Post subject: Reply with quote

It's probably best to set it to listen on a specific IP that you have instead of 0.0.0.0.

Is sshd already running? check your processes to make sure. :)
_________________
while(true) {self.input(sugar);} :twisted:
Back to top
View user's profile Send private message
klatk
n00b
n00b


Joined: 25 Jun 2004
Posts: 35

PostPosted: Wed Sep 14, 2005 10:57 pm    Post subject: Reply with quote

I can change it to listen to another IP. The question then becomes, what specific IP should I be setting it to listen to, and for that matter, why is the default config 0.0.0.0?

Quote:
Is sshd already running? check your processes to make sure.



If by that you mean that maybe I have more than one instance of sshd running, I don't know. I'll have to check. But that would be odd, wouldn't it?

Is there any way to find out via bind or something what's actually taking up that address?
Back to top
View user's profile Send private message
christsong84
Veteran
Veteran


Joined: 06 Apr 2003
Posts: 1003
Location: GMT-8 (Spokane)

PostPosted: Thu Sep 15, 2005 5:31 pm    Post subject: Reply with quote

klatk wrote:
I can change it to listen to another IP. The question then becomes, what specific IP should I be setting it to listen to, and for that matter, why is the default config 0.0.0.0?

Quote:
Is sshd already running? check your processes to make sure.



If by that you mean that maybe I have more than one instance of sshd running, I don't know. I'll have to check. But that would be odd, wouldn't it?

Is there any way to find out via bind or something what's actually taking up that address?


I believe 0.0.0.0 is to listen on any ip. Set it to the ip of your NIC. If it's been assigned via DHCP, run an ifconfig -a to find out the IP assigned to it.

It would be odd for more than one instance to be running but it's not out of the question...sometimes the service manager and the processes get out of sync with each other. :P
_________________
while(true) {self.input(sugar);} :twisted:
Back to top
View user's profile Send private message
Taladar
Guru
Guru


Joined: 09 Oct 2004
Posts: 458
Location: Bielefeld, Germany

PostPosted: Thu Sep 15, 2005 6:39 pm    Post subject: Reply with quote

Yes, 0.0.0.0 means all adresses on all interfaces. That should work fine. To find out what is using the adress try
Code:

lsof -Pin

("-P" not port number => name conversion, "-n" same for IP and hostnames, "-i" show IP connections/listeners)
Back to top
View user's profile Send private message
klatk
n00b
n00b


Joined: 25 Jun 2004
Posts: 35

PostPosted: Sun Sep 18, 2005 2:52 am    Post subject: Reply with quote

Taladar and Christsong84,

Thanks for the help!

I added 'ListenAddress' to my sshd_config to listen on my NIC's IP and sshd worked once I started it back up. I then used 'lsof -P -i -n' to find out what was taking up 0.0.0.0 and I didn't see anything there. So I went back and changed the 'ListenAddress' to 0.0.0.0 explicitly and it seems to be working fine now. I guess it just hadn't been specified before.
Back to top
View user's profile Send private message
ova
Retired Dev
Retired Dev


Joined: 06 Nov 2003
Posts: 120
Location: Russia, Moscow

PostPosted: Mon Oct 10, 2005 7:37 pm    Post subject: Reply with quote

Exactly the same problem here! And of course I have nothing listening on 22 port!

It seems very strange to me. To start sshd I have to specify in sshd config:
Code:

Listen 0.0.0.0

In other case I see the following error:
Code:

Oct 10 23:27:43 camobap sshd[30696]: Server listening on :: port 22.
Oct 10 23:27:43 camobap sshd[30696]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.


I thought it is because I have openssh compiled with ipv6 support, so when it binds itself on :: address then binding to 0.0.0.0 failes. But now I compiles openssh without ipv6 support and still have this problem. May be this is because I have ipv6 enabled in kernel :?: Can anybody help me to find out why I have such problem?

BTW. amd64 :!: livecd has exactly the same problem. After setting up networking I have to modify sshd config to start sshd!!!
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