CentOS系统提示用户名不在sudoers文件中
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.然后重啟即可
轉載于:https://blog.51cto.com/8656934/1689225
總結
以上是生活随笔為你收集整理的CentOS系统提示用户名不在sudoers文件中的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 小试Express
- 下一篇: jQuery图片轮播(焦点图)插件(转载