How to Allow “Root Login” in Google Compute Engine?

Google compute enginePin

I recently stumbled on Google’s compute engine, which looks similar to Amazon AWS. The best part is that Google is offering a free 60-day trial worth $300.

So, I decided to try Google VM instances with Server Pilot, but the root login keeps failing. After a little search, I found this tutorial on Server Pilot. Well, it did not work because some things have changed.

So, I will show you how to allow root login on your Google compute engine VMs.

I am currently using the 7GB RAM 2cores plan, which i am using to test MariaDB on serverpilot with one of the sites I manage. So, without wasting much time.

Allow Root Login on Google Compute VMs

1. Create your Instance, wait for it to complete, then click on SSH

2. Next you see details of your server or instance, switch to the root user with the following command.

Sudo su root

3. After you switch to the root user, you can change the password using the following command.

passwd root

This will change your root password to use it on Putty (Windows) or a terminal (Linux/Mac).

4. Now edit this file /etc/ssh/sshd_config with the following command

nano /etc/ssh/sshd_config

5. Change the following in that file; use the arrow directional keys on your keyboard. Change the line;

PermitRootLogin without-password

To

PermitRootLogin yes

Then change the following line;

PasswordAuthentication no

To

PasswordAuthentication yes

Then restart the server with the following command;

service ssh restart

Now you can use your Google compute VMs on Serverpilot or log in with root via Putty and terminals without any problem.

1 comment
  1. To create and manage virtual machine instances, you can use tools such as Google Cloud Platform Console, the gcloud command-line tool, or the REST API. To perform advanced configuration, connect to the instance using Secure Shell (SSH) or Remote Desktop Protocol (RDP) for Windows instances. Otherwise nice information, thanks for shared.

Leave a Reply

Your email address will not be published. Required fields are marked *

Next Article
Pokemon

How to Play Pokémon on Your Android Device: A Quick Guide

Related Posts
Where Was Foundation FilmedPin
Read More

Where Was Foundation Filmed?

If you’re a fan of the Apple TV+ series “Foundation,” you might be curious about the stunning locations…
Total
0
Share