在CentOS中执行sudo命令时报错:ctc is not in the sudoers file. This incident will be reported.

编程入门 行业动态 更新时间:2024-10-26 23:29:39

在CentOS中执行sudo命令<a href=https://www.elefans.com/category/jswz/34/1770019.html style=时报错: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

本文发布于:2024-03-23 22:08:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1743409.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时报   命令   CentOS   sudo   ctc

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!