dparks
dparks

Reputation: 51

Missing sudo access in Google Compute Engine

In Google compute engine I do not have sudo ability on my VM.

According to the documentation and other threads on this topic, it should automatically be created when I SSH in from the Google Console. It worked this way for a week or two and now prompts for a password (I also rebuilt a vm that did this same thing a couple of weeks ago).

I have tried letting my keys expire, opening and closing a new session, and external ssh and they all display the same problem.

Here is a screenshot from a new browser instance:

enter image description here

Upvotes: 1

Views: 1386

Answers (1)

Taher
Taher

Reputation: 572

You can try using “sudo -s” command from any user to directly switch to root and use sudo access. Also root password can be changed by using “passwd root” command after sudo access have been got.

That being said, the screen that you are getting is the lecture that is set to be displayed every time sudo is used. This can be changed in /etc/sudoers file by setting Defaults lecture=once as explained in this article. If the lecture is set to once, it will force the sudo command to show the prompt you are getting for the first time only.

Upvotes: 4

Related Questions