Tengo un Ubuntu Server 10.04.1 en ejecución. Cuando intenté iniciar sesión en el servidor a través de ssh, no pude. En cambio, recibí un connection refused
error. Traté de hacer ping a la máquina y obtuve respuesta! Entonces, la razón clara es que el demonio SSH se detiene.
Después de reiniciar, pude iniciar sesión en mi servidor a través de ssh. Después de un tiempo, miré mis registros /var/log/syslog
y encontré los siguientes registros:
Jan 16 10:57:09 myserver init: ssh main process ended, respawning
Jan 16 10:57:09 myserver init: ssh main process (2465) terminated with status 255
Jan 16 10:57:09 myserver init: ssh main process ended, respawning
Jan 16 10:57:09 myserver init: ssh main process (2469) terminated with status 255
Jan 16 10:57:09 myserver init: ssh main process ended, respawning
Jan 16 10:57:09 myserver init: ssh main process (2473) terminated with status 255
Jan 16 10:57:09 myserver init: ssh main process ended, respawning
Jan 16 10:57:09 myserver init: ssh main process (2477) terminated with status 255
Jan 16 10:57:09 myserver init: ssh main process ended, respawning
Jan 16 10:57:09 myserver init: ssh main process (2481) terminated with status 255
Jan 16 10:57:09 myserver init: ssh main process ended, respawning
Jan 16 10:57:09 myserver init: ssh main process (2485) terminated with status 255
Jan 16 10:57:09 myserver init: ssh main process ended, respawning
Jan 16 10:57:09 myserver init: ssh main process (2489) terminated with status 255
Jan 16 10:57:09 myserver init: ssh main process ended, respawning
Jan 16 10:57:09 myserver init: ssh main process (2493) terminated with status 255
Jan 16 10:57:09 myserver init: ssh main process ended, respawning
Jan 16 10:57:09 myserver init: ssh main process (2497) terminated with status 255
Jan 16 10:57:09 myserver init: ssh main process ended, respawning
Jan 16 10:57:09 myserver init: ssh main process (2501) terminated with status 255
Jan 16 10:57:09 myserver init: ssh respawning too fast, stopped
Busqué un problema / solución similar. Algunas personas dijeron que esto es causado por el demonio SSH tratando de empezar antes de la creación de redes y sugieren que el cambio ListenAddress
en el /etc/ssh/sshd_config
ser 0.0.0.0
. Creo que esta no es la causa en mi caso, porque mi problema ocurre después de que el sistema está funcionando.
¿Alguna idea que está causando esto? Este es Ubuntu Server y debería ejecutarse y acceder a él de forma remota mediante SSH.
ACTUALIZAR:
Aquí está el fragmento de registro que encontré en /var/log/auth.log
.
Jan 16 10:56:38 myserver sudo: user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/vim /etc/ssh/sshd_config
Jan 16 10:57:09 myserver sudo: user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/etc/init.d/ssh reload
Jan 16 10:57:09 myserver sshd[1465]: Received SIGHUP; restarting.
Jan 16 10:57:09 myserver sshd[2461]: Server listening on 0.0.0.0 port 22.
Jan 16 10:57:09 myserver sshd[2465]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 16 10:57:09 myserver sshd[2465]: fatal: Cannot bind any address.
Jan 16 10:57:09 myserver sshd[2469]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 16 10:57:09 myserver sshd[2469]: fatal: Cannot bind any address.
Jan 16 10:57:09 myserver sshd[2473]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 16 10:57:09 myserver sshd[2473]: fatal: Cannot bind any address.
Jan 16 10:57:09 myserver sshd[2477]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 16 10:57:09 myserver sshd[2477]: fatal: Cannot bind any address.
Jan 16 10:57:09 myserver sshd[2481]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 16 10:57:09 myserver sshd[2481]: fatal: Cannot bind any address.
Jan 16 10:57:09 myserver sshd[2485]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 16 10:57:09 myserver sshd[2485]: fatal: Cannot bind any address.
Jan 16 10:57:09 myserver sshd[2489]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 16 10:57:09 myserver sshd[2489]: fatal: Cannot bind any address.
Jan 16 10:57:09 myserver sshd[2493]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 16 10:57:09 myserver sshd[2493]: fatal: Cannot bind any address.
Jan 16 10:57:09 myserver sshd[2497]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 16 10:57:09 myserver sshd[2497]: fatal: Cannot bind any address.
Jan 16 10:57:09 myserver sshd[2501]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Jan 16 10:57:09 myserver sshd[2501]: fatal: Cannot bind any address.
Parece que este error comenzó a aparecer después de que volví a cargar el demonio SSH. ¿Debo evitar usar ssh reload
y usar ssh restart
en su lugar?