sudoing时要求密码的Google Cloud VM

编程入门 行业动态 更新时间:2024-10-09 01:17:20
本文介绍了sudoing时要求密码的Google Cloud VM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一直在使用Google Cloud debian VM,使用sudo进行超级用户任务完全没有问题(sudo不需要输入密码)。

I've been working with a Google Cloud debian VM and had no problem at all doing super user tasks using sudo (sudo was not asking for password).

今天,我像往常一样通过SSH连接,当我尝试 sudo某物 时,它开始要求输入密码:

Today I connected via SSH as usual and when I try to sudo something it started asking for password:

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密钥身份验证。

According to the documentation it should not ask for password as is already SSL Key authenticated connection.

推荐答案

我自己解决了此问题。我为有类似问题的任何人发布了我遵循的步骤:

I have solved this issue by myself. I post the steps i've followed for anyone who has a similar problem:

  • 删除VM 实例保留
  • 创建了用于恢复目的的新VM实例。
  • 附加了旧的VM磁盘到新实例
  • 安装到/ mnt /

  • Deleted the VM instance preserving the disk.
  • Created new VM instance for recovering pruposes.
  • Attached the old VM disk to the new instance
  • Mounted into /mnt/ # mount /dev/sdb1 /mnt/

  • 将root更改为已挂载的分区

  • Change root to mounted partition

    # chroot /mnt/

  • 现在根据需要编辑sudoers文件以及用户密码和组
  • 卸载磁盘

  • Now edit the sudoers file and the user password and group as needed
  • Unmount the disk

    # umount /dev/sdb1

  • 断开连接磁盘,删除恢复实例,然后使用相同的磁盘重新创建旧的VM
  • deattach the disk, delete the recovery instance, and recreate the old VM with the same disk
  • 更多推荐

    sudoing时要求密码的Google Cloud VM

    本文发布于:2023-11-24 11:59:21,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1625115.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:时要   密码   sudoing   VM   Cloud

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!