Lost SSH access after Upgrade to 18.04

6,453

Solution 1

I got the same warning and could not get back in too. I had two issues that needed to be fixed.

My VPS provider offers another way in with LISH. I noticed SSH errors in the boot up window. What was wrong with the SSH service? Running sudo /usr/sbin/sshd –T gave me a Missing privilege separation directory: /var/run/sshd error.

After following these instructions SSH problem after update, at least ssh would run.
mkdir /var/run/sshd chmod 0755 /var/run/sshd

But my key was still not accepted. Then I started tailing the auth.log. Lish cut off the line, so this was all I had to go on: error: userauth_pubkey: could not parse k . But the first Google hit led me to a report that showed that SSH was failing for key length on Windows boxes. Just on a hunch, I created a new public private key pair and installed it – and Voila, I am in. My old key had been 1024 bits, and was made so long ago that I cannot be sure what encryption method was used in it’s creation. https://github.com/PowerShell/Win32-OpenSSH/issues/855

Solution 2

It appears the allowed ciphers for OpenSSH have changed. I moved Blowfish to the top of the order in my client and was able to connect to one. On the other I had to comment out the Ciphers line in the sshd_config, that command is optional anyway. After that I was able to connect to both servers.

Share:
6,453

Related videos on Youtube

Oscar Smarty
Author by

Oscar Smarty

Updated on September 18, 2022

Comments

  • Oscar Smarty
    Oscar Smarty over 1 year

    After upgrading 2 16.04 servers to 18.04 I lost ssh access to both. During both upgrades I got a message asking if I wanted to keep my custom config file or if I would like to replace it. I chose to keep it as both servers are configured as SFTP servers. Any suggestions for how to get ssh for remote login available again would be appreciated.

    SFTP is still working for my configured users on both servers.

    Thanks!

    • curusarn
      curusarn almost 6 years
      You should update your question with more info. What are the exact commands you have executed? What are the outputs you are getting? "Lost ssh access" is not very specific.
    • Uwe Keim
      Uwe Keim about 3 years
      When upgrading a Bitnami Ubuntu 16 to Ubuntu 18 on Amazon AWS EC2 or Lightsail, this thread might also help.