首页 > 其他 > 详细

CentOS系统提示用户名不在sudoers文件中

时间:2015-08-28 13:37:15      阅读:283      评论:0      收藏:0      [点我收藏+]

1.切换到root用户

[TZ@localhost 桌面]$ su -

密码:

[root@localhost ~]# ll /etc/sudoers

-r--r-----. 1 root root 4038 6  29 10:17 /etc/sudoers

2.修改/etc/suoders权限为可写

[root@localhost ~]# chmod 777 /etc/sudoers

查看文件权限,颜色变为绿色

[root@localhost ~]# ls -l /etc/sudoers

-rwxrwxrwx. 1 root root 4038 6  29 10:17 /etc/sudoers

3.编辑修改/etc/sudoers文件

[root@localhost ~]# gedit /etc/sudoers

TZ    ALL=(ALL)     NOPASSWD: ALL

4.保存退出并恢复/etc/sudoers的访问权限为440

[root@localhost ~]# chmod 440 /etc/sudoers

[root@localhost ~]# ls -l /etc/sudoers

-r--r-----. 1 root root 4038 6  29 10:17 /etc/sudoers

5.然后重启即可

本文出自 “DOSOM” 博客,谢绝转载!

CentOS系统提示用户名不在sudoers文件中

原文:http://8656934.blog.51cto.com/8646934/1689225

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!