# [SOLVED] sshd: can't restart

## jonnevers

I just updated to net-misc/openssh-4.7_p1-r3 and I cannot restart the service:

```
host root # /etc/init.d/sshd restart

 * Stopping sshd ...                                                                                                             [ !! ]

host root #
```

what about manually?

```
host root # start-stop-daemon --stop --exec "/usr/sbin/sshd" --pidfile "/var/run/sshd.pid"

No /usr/sbin/sshd found running; none killed.
```

system status?

```
host root # cat /var/run/sshd.pid

11995

host root # file /usr/sbin/sshd

/usr/sbin/sshd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), stripped

host root # ls -lh /usr/sbin/sshd

-rwxr-xr-x 1 root root 352K Jan 28 09:29 /usr/sbin/sshd

host root # ps -ef | grep -i ssh

root      9610 11995  0 12:07 ?        00:00:00 sshd: user [priv]

user      9612  9610  0 12:07 ?        00:00:00 sshd: user@pts/2

root      9981  9631  0 12:16 pts/2    00:00:00 grep --colour=auto -i ssh

root     11995     1  0  2007 ?        00:00:04 /usr/sbin/sshd

root     17443 11995  0 00:00 ?        00:00:00 sshd: user [priv]

user     17445 17443  0 00:00 ?        00:00:03 sshd: user@pts/1

host root #
```

everything looks ok to me? any suggestions besides manually kill the daemon (since I am currently remote)?Last edited by jonnevers on Mon Jan 28, 2008 9:56 pm; edited 1 time in total

----------

## magic919

Kill the daemon.  Leave the remote connections alone and you'll be fine.  I generally log in from a second remote session to be sure.

----------

## StarDragon

What about 

```
cat /var/log/messages
```

----------

## coolsnowmen

after killing the sshd process, you might need to zap the service to restart it

```

/etc/init.d/sshd zap

/etc/init.d/sshd start
```

----------

## jonnevers

 *coolsnowmen wrote:*   

> after killing the sshd process, you might need to zap the service to restart it

 

I know how to work with init scripts, I was just concerned with why sshd wasn't stopping properly when everything appears to be proper. The main reason for concern is because the last time the sshd init script was unable to bring down sshd was because the host was compromised and a hacked sshd was running on a high port. 

All of that has been cleaned up and no unknown ports are open and all processes have been accounted for.

So i sent the primary sshd a kill -s TERM but unfortunately i then ran 'stop' on the init script which did kill all connected sessions and since i -s TERM'd the daemon, I'm locked out for the time being   :Razz: 

I will check /var/log/messages when I'm local to the machine.

----------

## jonnevers

after getting back locally to the machine, sshd is running again and can be restarted properly via the init script. still not sure what the issue was.

I have no /var/log/messages but /var/log/everything/current didn't show anything to note unfortunately.

----------

## bunder

i got the same problem... been noticing it now for a while...  i used to be able to restart sshd whilst being logged in but now that doesn't work...  i really don't want to log onto these machines locally because it royally messes up my utmp.

----------

