-1

I can't ssh into Oracle Cloud Ubuntu 20.04 instance after do-release-upgrade. It was upgrading well but then prompted for a reboot, after the reboot, I can't access the server via ssh.

I have noticed that I can access it via oracle Cloud Console but then it prompts for username and password. Username is Ubuntu but password has not been set as putty keys were used to access ssh.

I was upgrading my Ubuntu version on my cloud server. I was expecting it to allow me to ssh to my server as I normally ssh to it after it was done.

I have tried using ChatGPT to assist with different options, including this approach to reset the password for the "ubuntu" user.

ChatGPT suggested:

  • Reboot the instance. During the reboot process, hold down the Shift key to access the GRUB menu.

  • In the GRUB menu, select Advanced options for Ubuntu. Choose the option ending with (recovery mode).

  • When prompted, choose to enter the root shell.

  • The root filesystem is initially mounted as read-only. Remount it in read/write mode:

    mount -o remount,rw /
    
  • Type the following command to change the password for the ubuntu user:

    passwd ubuntu
    
  • Follow the on-screen instructions to set a new password.

  • Reboot the system:

    reboot
    
  • Return to the console window. Enter the username "ubuntu". Use the new password you set to log in.

But I am still unable to change the password to login via Oracle Cloud Console nor access the server via ssh.

1 Answers1

-1

Why you cannot connect to the server:

As @Organic Marble said in the comments, the reason why you cannot ssh to your server is because do-release-upgrade overwrote your sshd config. You will have to use the Cloud Console to access you server and reconfigure the sshd.

If you want to understand the reason why this happaned, check this: Should I replace the customized configuration file during release upgrade?

How to get to the GRUB menu:

I had a similar problem a while ago. The difference is that you are using Oracle Cloud Console, while I was using Proxmox Console. Most consoles are similar, so it shouldn't differ much.

What ChatGPT suggested is pretty close to what you have to do. The difference is that in the console you need to press Esc during the start/restart of the server. Try pressing it several times.

Once you get to the GRUB menu, you can change your password, setup your sshd and do whatever you want. Please, don't follow blindly what ChatGPT suggests, you system is probably already mounted as read/write.

sotirov
  • 4,379