View previous topic :: View next topic |
Author |
Message |
klatk n00b
Joined: 25 Jun 2004 Posts: 35
|
Posted: Wed Sep 14, 2005 7:01 pm Post subject: sshd/bind problem [solved] |
|
|
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 |
|
|
christsong84 Veteran
Joined: 06 Apr 2003 Posts: 1003 Location: GMT-8 (Spokane)
|
Posted: Wed Sep 14, 2005 7:29 pm Post subject: |
|
|
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);} |
|
Back to top |
|
|
klatk n00b
Joined: 25 Jun 2004 Posts: 35
|
Posted: Wed Sep 14, 2005 10:57 pm Post subject: |
|
|
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 |
|
|
christsong84 Veteran
Joined: 06 Apr 2003 Posts: 1003 Location: GMT-8 (Spokane)
|
Posted: Thu Sep 15, 2005 5:31 pm Post subject: |
|
|
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. _________________ while(true) {self.input(sugar);} |
|
Back to top |
|
|
Taladar Guru
Joined: 09 Oct 2004 Posts: 458 Location: Bielefeld, Germany
|
Posted: Thu Sep 15, 2005 6:39 pm Post subject: |
|
|
Yes, 0.0.0.0 means all adresses on all interfaces. That should work fine. To find out what is using the adress try
("-P" not port number => name conversion, "-n" same for IP and hostnames, "-i" show IP connections/listeners) |
|
Back to top |
|
|
klatk n00b
Joined: 25 Jun 2004 Posts: 35
|
Posted: Sun Sep 18, 2005 2:52 am Post subject: |
|
|
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 |
|
|
ova Retired Dev
Joined: 06 Nov 2003 Posts: 120 Location: Russia, Moscow
|
Posted: Mon Oct 10, 2005 7:37 pm Post subject: |
|
|
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:
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 |
|
|
|