当前位置:首页 > 操作系统 > Linux

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

Ref:http://blog.sina.com.cn/s/blog_4aa35ca101012qb6.html

装完linux系统,发现普通用户无法使用sudo 命令,下普通用户无法使用sudo命令的解决方法" src="http://simg.sinajs.cn/blog7style/images/common/sg_trans.gif" />

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

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

我们可以这样做

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

输入超级用户root密码

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

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

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

  User1 ALL=(ALL)        ALL

:wq  (保存并退出)

[User1@localhost~]#chmod u-w /etc/sudoers   (这里我们再把root对sudoers这个文件的写权限去掉,嘿嘿下普通用户无法使用sudo命令的解决方法" src="http://simg.sinajs.cn/blog7style/images/common/sg_trans.gif" />)

原文:http://www.cnblogs.com/cslxiao/p/3579889.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐