我在通过/ etc / sudoers文件将用户添加到sudoers列表时遇到了问题。
$ whoami iain
他们说我疯了!
$ which visudo /usr/sbin/visudo $ ls -la /usr/sbin/visudo ---x--x--x 1 root wheel 186768 23 Jun 2009 /usr/sbin/visudo $ sudo su - Password: macbook:~ root# whoami root macbook:~ root# visudo
该文件在vi中打开:
# this line is the one I added to sudoers # I gave ALL as access to try and get this to work # it's the same setting as my account, which works. %yvonne ALL=(ALL) ALL
我保存文件。 它在这里显示“不变”,因为我已经做到了。
visudo: /etc/sudoers.tmp unchanged macbook:~ root# logout
以yvonne身份login…
$ sudo su - yvonne yvonne@87 02/08/2013 19:34 $ whoami yvonne
尝试通过sudo运行任何东西:
yvonne@88 02/08/2013 19:34 $ sudo ls WARNING: Improper use of the sudo command could lead to data loss or the deletion of important system files. Please double-check your typing when using sudo. Type "man sudo" for more information. To proceed, enter your password, or type Ctrl-C to abort. Password: **yvonne is not in the sudoers file. This incident will be reported.**
我很困惑,任何人都可以给我任何帮助或见解,让我可以让yvonne帐户访问sudo ? 这将不胜感激。
%是sudoers中的组赋值运算符。 我想你想要的行读取:
yvonne ALL=(ALL) ALL