Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

google compute engine VM instance : my root password?

I'm using google cloud platform compute engine.
I created a VM instance (OS : Ubuntu 16.04)
I want to change some system config. However system requires me to enter password.

enter image description here

I haven't got password. I don't know my password.

What is my password?

like image 653
newbie16 Avatar asked Sep 16 '17 12:09

newbie16


2 Answers

By default there is no root password on GCE instances. You have several options:

  1. As all users are added to sudoers, you can run the command as root with: sudo invoke-rc.d procps start
  2. You can log in as root with sudo -i
  3. You can set a root password by running sudo passwd
like image 148
David Avatar answered Nov 14 '22 04:11

David


GCE don't set any clear-text password for any user, it only sets ssh keys You can ssh into instance directly from web console
You can use all root privileges by using sudo [COMMAND --ARG1..]
To set root password ssh into instance
Type : sudo passwd root (for linux machines)
It will ask for new password but whatever password you are typing won't show, It's hidden, just press enter after done typing
Also if you are trying to ssh into instance as root, you will need to edit /etc/ssh/sshd.config and change Permit root login and Password Authentication to yes

Hope it helps

like image 33
Solaris Avatar answered Nov 14 '22 05:11

Solaris