sudoing时要求密码的Google Cloud VM [英] Google Cloud VM when sudoing asks for password
问题描述
我一直在使用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/
卸载磁盘
Unmount the disk
# umount /dev/sdb1
这篇关于sudoing时要求密码的Google Cloud VM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!