简体   繁体   English

Sudo不工作 - “sudo:有效的uid不是0,sudo是否安装了setuid root?”

[英]Sudo not working - “sudo: effective uid is not 0, is sudo installed setuid root?”

I have been trying to allow access to the normal user of an EC2 amazon server ('ec2-user') to a certain library. 我一直试图允许访问EC2亚马逊服务器('ec2-user')的普通用户到某个库。

I did: "sudo chown -R ec2-user /usr" which I realize now had been a fatal mistake. 我做了:“sudo chown -R ec2-user / usr”我现在意识到这是一个致命的错误。 It worked, but sudo is gone. 它奏效了,但是sudo已经不见了。 If I try to use sudo I get: "sudo: effective uid is not 0, is sudo installed setuid root?" 如果我尝试使用sudo,我得到:“sudo:有效的uid不是0,sudo是否安装了setuid root?”

I tried "chmod u+s /usr" like it is suggested in another answer. 我尝试了“chmod u + s / usr”,就像在另一个答案中建议的那样。 It does not solve the issue. 它没有解决问题。

I guess that there is something basic I am missing. 我想有一些我缺少的基本知识。 Forgive my newb ignorance. 原谅我的新生无知。

The suid bit of the permissions for sudo changes the effective user to the owner of the sudo command file, which you changed to be ec2-user. sudo权限的suid位将有效用户更改为sudo命令文件的所有者,您将其更改为ec2-user。 You need to give ownership of the sudo command back to root. 您需要将sudo命令的所有权归还给root。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM