码迷,mamicode.com
首页 > 系统相关 > 详细

linux 下普通用户无法使用sudo命令的解决方法

时间:2015-06-22 22:03:52      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:

装完linux系统,发现普通用户无法使用sudo 命令,

提示:xinhuan(普通用户)is not in the sudoers file, This incident will be reported.

大概意思是说xinhuan 这个用户不在sudoers这个文件里,这个事件将要被报告的。

我们可以这样做

[xinhuan@localhost~]$su -    (切换到root)

输入超级用户root密码

[xinhuan@localhost~]#chmod u+w /etc/sudoers    (添加root对sudoers这个文件的写权限)

[xinhuan@localhost~]#vi /etc/sudoers           (编辑sudoers,把xinhuan这个用户添加进去)

找到 root ALL=(ALL)        ALL 这行 ,并在此行下添加

  xinhuan ALL=(ALL)        ALL

:wq  (保存并退出)

[xinhuan@localhost~]#chmod u-w /etc/sudoers   (这里我们再把root对sudoers这个文件的写权限去掉)

linux 下普通用户无法使用sudo命令的解决方法

标签:

原文地址:http://www.cnblogs.com/masamia/p/4593910.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!