New users without Server/SSH knowledge may struggle to login as root in Google Cloud VPS Compute Engine. You cannot login as a root user with a password. Google has disabled this by default due to security reasons and I will not be discussing how to change that. Instead, I will tell of a simple command that you can use after you login using the SSH that is provided for your instance on Google Cloud VM Instances page.
LogĀ in to Google Cloud and on the VM instances page under Compute Engine. You will see the list of VMs/Instances that you have running. Simply click SSH there.
Now a new window will open that will log you in as yourusername@
. This is a non root account. Simply use the command below to change to the root user:
sudo su root
And you are done!
wow, so simple dude. Thanks.