I cannot ssh to my Debian 7 server anymore. It happened after I tried to upgrade some packages on this old distro (including libc6…). Uptime is almost 2200 days! I do not even want to risk restarting it.
ssh -V returns
OpenSSH_6.0p1 Debian-4+deb7u7, OpenSSL 1.0.1t 3 May 2016
I somehow still have an active ssh connection on Putty as a root so I can still run commands. Hopefully I will not lose it before I fix this massive issue!
nothing outputs when I run
/etc/init.d/ssh restart, it just prompts a new line for new commands.
ps -f -p $(pgrep sshd) shows a pid and uid root
/usr/sbin/sshd does not exist
cat /etc/ssh/sshd_config shows nothing any different than it has always been. I run it on port 22000. No issues since 6 years until now. I now explicitly opened the port 22000 on iptables just to make sure but nothing changed.
sftp -oPort=22000 -vvv root@redacted_for_privacy shows
OpenSSH_6.0p1 Debian-4+deb7u7, OpenSSL 1.0.1t 3 May 2016 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to redacted_for_privacy (123.456.redacted_for_privacy.123) port 22000. debug1: connect to address 123.456.redacted_for_privacy.123 port 22000: Connection refused ssh: connect to host redacted_for_privacy port 22000: Connection refused Couldn't read packet: Connection reset by peer
netstat -tulpn | grep 22000 returns nothing, however it does return udp6 for
ps aux | grep sshd returns :
root 12247 0.0 0.0 29920 1252 pts/0 T Nov21 0:00 vim /etc/ssh/sshd_config root 12248 0.0 0.0 29924 1308 pts/0 T Nov21 0:00 vim /etc/ssh/sshd_config root 25974 0.0 0.0 6312 788 pts/0 S+ 01:09 0:00 grep sshd root 31003 0.0 0.0 81232 3932 ? Ss Nov21 0:14 sshd: root@pts/0
vim is because i set
PermitRootLogin yes (it had always been set at
without-password). 31003 is sshd pid
I also tried to reinstall:
apt-get install openssh-server but it returned
openssh-server : Depends: openssh-client (= 1:6.0p1-4+deb7u4) but 1:6.0p1-4+deb7u7 is to be installed
E: Unable to correct problems, you have held broken packages. which is probably very true considering the ugly tinkerings I tried in order to upgrade libc6!
tail -f /var/log/auth.log when I try to ssh via WinSCP does not show any new line appending. either trying on port 22 or custom 22000.
netstat -ntlp returns
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 12431/proftpd: (acc tcp 0 0 0.0.0.0:3129 0.0.0.0:* LISTEN 4374/(squid) tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 4917/nginx tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 7231/mysqld tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN 10330/perl tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 4917/nginx
I tried behind a different ip, I’m sure I did not jail myself.
The 4 websites hosted on it currently keep working as if nothing ever happened.
I am out of ideas and desperate. What else should I check/try? I believe it is not running sshd but I have not idea how to restart it. I do not have
service sshd restart, and nothing in