我可以将自己添加到“ root”组吗?


26
$ id
uid=1000(kev) gid=1000(kev) groups=1000(kev),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare)

$ ls -l /etc/sudoers
-r--r----- 1 root root 723 Jan 31  2012 /etc/sudoers

$ sudo adduser kev root
Adding user `kev' to group `root' ...
Adding user kev to group root
Done.

$ cat /etc/sudoers
cat: /etc/sudoers: Permission denied

将我自己添加kev到分组后root,我仍然无法阅读/etc/sudoers

我不知道为什么 谢谢你的帮助。

Answers:



14

要刷新用户的组成员身份kev而不注销:

exec su -l kev

要将组名设为整个会话的默认组:

newgrp groupname

要打印当前组,您是(source)的成员:

groups
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.