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?
Asked
Active
Viewed 253 times
-1
-
What Google Cloud IAM Roles does your Google Cloud Console account have? – John Hanley Sep 11 '19 at 01:12
-
Also try `sudo bash` to launch a root shell. – John Hanley Sep 11 '19 at 01:13
-
1Seems you have to set a password first. https://stackoverflow.com/q/35016795/5101148 – Simba Sep 11 '19 at 05:48
-
Default password is insecure. That's why no password exists by defaut – guillaume blaquiere Sep 11 '19 at 08:32
1 Answers
2
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:
- 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.
- Create a password for the user:
sudo passwd $(whoami)
Please note that this password will be also used on the screen lock.

Pawel Czuczwara
- 1,442
- 9
- 20