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
• 8,200 points
79 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
• 45,960 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
• 45,960 points
39 views
0 votes
1 answer
0 votes
1 answer

How to add a PTR record to my VM instance on gcp?

If your VM instance uses the primary ...READ MORE

answered Sep 26, 2019 in GCP by Sirajul
• 45,960 points
88 views
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer