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