How to get root password

I have installed Ubuntu in Google cloud but I can’t login using ssh. And I don’t have root password to login. Someone please help me in this.

Thanks in advance!

They don’t offer plain text password. The simplest way would be login via Web Console.

:warning: If you are using Google Cloud, always keep backup!!! I have faced a lot of problem with it.

Hmmm… I want to login using winscp with root. Is it possible?

Sorry! I don’t know

If you don’t know only God knows.

cc: @rishi Have you tried Putty for GCP? Please look into this case.

Thanks

1 Like

I use Web Console only whenever I need

Yes, I can access this way. But I want to access using winscp tool.

Here is one relevant guide. I have not tried it. Please see if this help.

Hi

Create SSH key using putty and save both private and public keys

To login with putty using SSH keys there are two ways:-

First

  1. Navigate to GCP console )) Compute engine.
  2. Locate Metadata option in left panel / menu.
  3. Navigate to Metadata )) SSH keys.

Add new ssh key in this format :-

 ssh-rsa [PUBLIC_KEY_VALUE] [USERNAME]

Second

  1. Access server using browser SSH client.
  2. Add new ssh key in authorized_keys file.
  3. Access server using SSH key.

To add ssh key:-

mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys

chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys

nano ~/.ssh/authorized_keys

Reference :- https://www.linode.com/docs/security/authentication/use-public-key-authentication-with-ssh/

1 Like

Though I had not tried this but it may work. Also, SSH with password is never recommended.

  1. Edit /etc/ssh/sshd_config and enable PasswordAuthentication

  2. Create a new user with password:- https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04

Access using putty.

2 Likes