fedora22 admin is not in the sudoers file
环境:全新安装 Fedora 22,安装时将用户名设为 admin
。
现象:执行 sudo
时提示
admin is not in the sudoers file. This incident will be reported.
解决步骤
切换到 root
su -
编辑 sudoers 文件
visudo
找到并修改配置
定位到:## Allow root to run any commands anywhere root ALL=(ALL) ALL
在其下方 新增一行:
## Allow root to run any commands anywhere root ALL=(ALL) ALL admin ALL=(ALL) ALL
保存并退出
在 vim 中按Esc
,输入:wq
回车。验证
打开新的终端,执行:sudo gedit /etc/test
不再报错即可。
编辑完成后,用户
admin
即拥有完整sudo
权限。