Connect to an instance as a root user in GCP

0 votes
I have configured a Linux VM instance to allow SSH as the root user and configure an SSH key for the root user on that instance. How can I connect to it as the root user?
Sep 24, 2019 in GCP by anonymous
• 19,620 points
2,153 views

1 answer to this question.

0 votes

If you configured an instance to allow SSH as the root user and configure an SSH key for the root user on that instance, you can connect as root using the gcloud compute ssh command with root@ specified before the instance name:

gcloud compute ssh --project [PROJECT_ID] --zone [ZONE] root@[INSTANCE_NAME]

where:

  • [PROJECT_ID] is the ID of the project that contains the instance.
  • [ZONE] is the name of the zone in which the instance is located.
  • [INSTANCE_NAME] is the name of the instance.
answered Sep 24, 2019 by Sirajul
• 59,090 points

Related Questions In GCP

0 votes
1 answer

Adding previlages to a user in GCP

The permission "servicenetworking.services.addPeering" is enclosed within the role "compute.NetworkAdmin". If you would ...READ MORE

answered Oct 10, 2019 in GCP by Sirajul
• 59,090 points
259 views
0 votes
1 answer

How to create a Cloud Filestore instance in GCP?

Hi@MD, You can create a Cloud Filestore instance in ...READ MORE

answered Nov 10, 2020 in GCP by akhtar
• 38,210 points
154 views
0 votes
1 answer
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer