I have an Ubuntu 18.04 server. I installed
openssh-client. According to
apt, the installed version of both packages is
7.6p1-4ubuntu0.1, but the running version of the ssh-server (
OpenSSH_6.7p2 Ubuntu-4p1. The version of the client (
ssh) is correct.
I already restarted the server several times, but the running version is still the same.
Recently I reinstalled OpenSSH, because my clients couldn't connect to the server with version 6.7. See: SSH connection closed right after login
It worked for a while, but then it suddenly switched back to version 6.7. (the installed package is still 7.6)
Could anybody please help me with this? I don't understand how the running version can differ from the package version.
This is the output of the command
dpkg -l | grep openssh as requested in the comments:
ii openssh-client 1:7.6p1-4ubuntu0.2 amd64 secure shell (SSH) client, for secure access to remote machines ii openssh-server 1:7.6p1-4ubuntu0.2 amd64 secure shell (SSH) server, for secure access from remote machines ii openssh-sftp-server 1:7.6p1-4ubuntu0.2 amd64 secure shell (SSH) sftp server module, for SFTP access from remote machines
It might also be worth noting that I get the following error in the syslog when trying to log in:
sshd: segfault at ad6cd950 ip 00007f50883835a1 sp 00007ffcfb4f35f8 error 4 in libc-2.27.so[7f50881f5000+1e7000]
After removing OpenSSH and reinstalling it again as recommended in this answer, it worked for an hour. This did not happen after a reboot or update.
ssh.service seems not to be running anymore. By running
ps -o unit -p <process id>, I found out that the process has been started by
env.service. I guess that is not correct, because right after the fresh installation,
sshd has been started by
ssh.service. But how can I change that behavior? I don't know, what
Something keeps replacing
/usr/sbin/sshd with the old version within less than an hour after reinstalling
openssh-server. I can see that the MD5 hash has been changed.