FC 10对用户的权限管理的很严,关于root的登录虽然使用方便,但是对系统不安全,通常用户跨越权限时使用sudo来获得执行的权利。
在FC 10中,使用sudo后,会提示 ”user" is not in the sudoers file. This incident will be reported.
从提示内容可以知道,当前用户不属于sudoers
此文件存入在/etc下,当然当前用户是没有权限访问的。
只好su root
修改文件属性,使文件可写
chmod u+w /etc/sudoers
vi /etc/sudoers
可以看到一条记录
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
cspark ALL=(ALL) ALL
也就是说将当前用户名加入,就属于sudoers,可以执行所有的命令。
保存后,加入的用户命,便是可以合法利用sudo。
恢复文件属性
chmod u-w /etc/sudoers
本文介绍如何在FC10系统中为普通用户添加sudo权限,包括修改sudoers文件的过程及注意事项。
775

被折叠的 条评论
为什么被折叠?



