Est*_*lli 2 debian sudo virtual-machine google-cloud-platform
我一直在使用 Google Cloud debian 虚拟机,并且使用 sudo 执行超级用户任务完全没有问题(sudo 不要求输入密码)。
今天我像往常一样通过 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 -----:
Run Code Online (Sandbox Code Playgroud)
根据文档,它不应要求输入密码,因为已经是 SSL 密钥身份验证的连接。
今天我在 CentOS 8.x 虚拟机上遇到了同样的问题。经过一些测试我发现了一个更简单的解决方案。允许在 /etc/sudoers.d/google_sudoers 文件中使用 sudo 组“google-sudoers”,因此,要解决该问题并使其永久,请按照以下步骤将您的用户添加到“google-sudoers”组:
sudo usermod -a -G google-sudoers USER
将您的用户添加到 google-sudoers 组您应该能够运行 sudo 命令或再次获得 root 权限。
归档时间: |
|
查看次数: |
4014 次 |
最近记录: |