时报错:ctc is not in the sudoers file. This incident will be reported."/>
在CentOS中执行sudo命令时报错:ctc is not in the sudoers file. This incident will be reported.
一、报错
ctc is not in the sudoers file. This incident will be reported
说明:ctc用户不具备sudo的权限
二、解决
1、首先,输入su,切换到root用户下;
然后输入sudo chmod u+w /etc/sudoers 赋予sudoers文件写权限
输入sudo vi /etc/sudoers 点击回车。出现Press ENTER or type command to continue,点击Enter键。
2、按向上和向下箭头导航到需要编辑的位置,如图,在大约倒数第16行的位置,添加
xxx ALL=(ALL) ALL。xxx为自己的用户名。添加的方法:点击键盘上的“Insert”键,然后输入。
3、输入完成后,按esc退出编辑模式。然后按shift键加:,输入wq。点击回车,即保存并退出到终端。
4、按ctrl + D退出会话,至此,给用户ctc添加权限成功。
更多推荐
在CentOS中执行sudo命令时报错:ctc is not in the sudoers file. This incident will be report
发布评论