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 in GCP by anonymous
• 6,670 points
49 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 by Sirajul
• 40,990 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 in GCP by Sirajul
• 40,990 points
29 views
0 votes
1 answer
0 votes
2 answers
0 votes
1 answer