Search code examples
google-cloud-platformsudosudoersgoogle-dl-platform

Unable to sudo to Deep Learning Image


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?


Solution

  • 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.