宇筱博客

  • 解决办法
  • 学无止境
  • 记录时光
  • 百宝箱
宇筱博客
点滴记忆,汇聚成海。
  1. 首页
  2. 解决办法
  3. 正文

Centos7提示" xxx 不在 sudoers 文件中。此事将被报告。"

2020年1月1日 583点热度 0人点赞 0条评论

一、问题描述

在安装Nginx的过程中以普通用户执行以下命令:

sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

提示

[sudo] password for fendo:
Sorry, try again.
[sudo] password for fendo:
fendo 不在 sudoers 文件中。此事将被报告。

二、解决方法

使用root用户登录

su  
cd /etc  
chmod 740 sudoers  
vim sudoers

末尾加上

fendo   ALL=(root) ALL, !/usr/bin/passwd [A-Za-z]*, !/usr/bin/passwd root

上面的指令就是说, 给账户 fendo 除了修改其他账户密码之外的所有操作权限,然后保存退出即可。

注:

也可以直接输入命令visudo,他会自动打开/etc/sudoers

原文链接:https://blog.csdn.net/u011781521/article/details/75675843

标签: 暂无
最后更新:2020年1月1日

小渔民

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2025 宇筱博客. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

豫ICP备15017825号-2