Google Cloud:计算VM实例;再也不能sudo了

时间:2017-05-09 19:42:01

标签: google-cloud-platform sudo

我在GC上为客户端安装了一个VM。在尝试通过FTP修复问题以复制文件时,我添加了我拥有的2个帐户,包括VM的原始帐户到组www-data。

从那以后,我不能做任何sudo。它要我输入root密码。我以前没有创建过,因为在Google VM上通常不需要它。

我收到此消息:

    xxxxxxx@wordpress-xxxxxxx-vm:/etc$ sudo su

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 xxxxx:

如何获得root权限来修复这个混乱?

此消息似乎意味着将从sudoers中删除用户?

感谢您的帮助。

1 个答案:

答案 0 :(得分:2)

答案是这个问题是由于我在创建usermod -aG groupname用户名时忘记放-a引起的。所以我的google用户已从/ etc / group

中删除了多个组 实际上

/ etc / sudoers是正确的。

为了解决这个问题,我已经将驱动器安装在另一台虚拟机上以修复文件,然后使用该固定驱动器重新创建一个新的虚拟机。

相关问题