2

I installed the latest Google Cloud Deep Learning VM Image today, after VM was launched, I was able to do sudo -i successfully via SSH web. Once I login, I start my Tensorflow model training running in background (Using &). Few hours later I'm unable to login as root. I get the following message:

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.
[sudo] password for my_username: 

I tried:

  • sudo -i
  • su sudo -i
  • su root

I was able to replicate the issue. Any suggestions?

simhumileco
  • 31,877
  • 16
  • 137
  • 115
gogasca
  • 9,283
  • 6
  • 80
  • 125
  • It isn't clear to me what error you are getting. Looking at the messages, when you run `sudo` it appears to be asking for the password for the userid that you requesting root user access from. Have you entered that password? If so, what are the penultimate messages you see? – Kolban Oct 11 '18 at 16:26
  • For reference I connect via SSH option via web browser. The username is my local laptop username I'm connecting it from. I did type my own local password and I get prompted: [sudo] password for my_username: Sorry, try again. (I always get Sorry, try again) weird issue is that It works when I launched a new VM. As soon as I let it run a background process using &. I tried to login and same issue. – gogasca Oct 11 '18 at 16:31

2 Answers2

2

This issue was caused due to an internal Google side and removes the user from “Google-sudoers” group. For all affected instances, I suggest following the below workaround until the permanent fix has been rolled out.

  1. Use a different username:

    • If using browser SSH window, click on the settings icon (top right), and click change Linux name in the drop down.
    • Using the SDK $ gcloud compute ssh newusername@instance
  2. Enable OS Login on the instance (set "enable-oslogin=True" in metadata) and per this article

You can track the permanent fix by following the Public Issue tracker.

Ariv
  • 183
  • 7
1

The original answer:

Maybe the solution will be to add a SSH Key for Google Cloud Console and log in with another SSH client.

Additional answer:

I do not know why, but sometime the user suddenly stopped being a member of the google-sudoers group... Then it's enough add your user to this group by some other user with administrator privileges to this group:

# usermod -G google-sudoers your_user_name

of course, if there is such a user...

simhumileco
  • 31,877
  • 16
  • 137
  • 115