Saturday, October 23, 2021

[SOLVED] What is my password when I connect via SSH?

Issue

I created a Debian VM in the Google Cloud, clicked on SSH from the GCP interface. A console shell opened, no problem, I'm logged in. Now I want to use sudo: it asks me for my current password. What is my password? Also, what is the root password?


Solution

The user account created by Google Compute Engine doesn't set a password. As an implication it is impossible to use sudo and most screen-locking apps can't unlock. To set password follow steps from the documentation:

  1. Connect to the instance using SSH, as you did when you first set up the instance. Here is the documentation how to connect using SSH.
  2. Create a password for the user: sudo passwd $(whoami)

Please note that this password will be also used on the screen lock.



Answered By - Pawel Czuczwara