谷歌云VM当sudoing要求密码

问题描述:

我一直在使用谷歌云debian虚拟机,并没有任何问题使用sudo做超级用户任务(sudo没有要求输入密码)。谷歌云VM当sudoing要求密码

今天,我通过SSH连接像往常一样,当我尝试sudo的东西它开始要求密码:

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

根据该文件不应该要求密码已经是SSL密钥认证连接。

我自己解决了这个问题。我的帖子我已经遵循的人谁也有类似问题的步骤:

  1. 删除虚拟机实例保留的磁盘。
  2. 创建用于恢复pruposes的新VM实例
  3. 附加老VM磁盘到新的实例
  4. 装入到/ mnt/

    # mount /dev/sdb1 /mnt/ 
    
  5. 更改根挂载的分区

    # chroot /mnt/ 
    
  6. 现在编辑sudoers文件和用户密码和组根据需要
  7. 卸载磁盘

    # umount /dev/sdb1 
    
  8. deattach磁盘,删除恢复实例,重建原有VM具有相同的磁盘