久久青草精品A片狠狠,日韩欧美视频一区二区,亚洲国码AV日韩,国产精品黄在

centos普通用戶設置sudo權限

2016-08-09 06:50:55 5632

在root用戶下創建一個普通測試用戶test,切換到test用戶,執行mkdir或者rm -rf 
會出現Permission denied,錯誤原因是:該用戶暫沒有root權限

[test@iZ2513wqj05Z app]$ mkdir testmkdir: cannot create directory test? Permission denied
[test@iZ2513wqj05Z app]$

解決辦法:

1:切換到root用戶

[test@iZ2513wqj05Z app]$ su rootPassword: [root@iZ2513wqj05Z app]#

2 :賦予普通用戶root權限

編輯/etc/sudoers配置文件,找到下面一行,在root下面添加一行,如下所示:  root ALL=(ALL) ALL  test ALL=(ALL) ALL  修改完畢,現在可以用test帳號登錄,然后用命令 su - ,即可獲得root權限進行操作。

3:退出root用戶

[root@iZ2513wqj05Z app]# exitexit
[test@iZ2513wqj05Z app]$

4:執行linux命令:sudo mkdir test

[test@iZ2513wqj05Z app]$ sudo mkdir test
[sudo] password for test: [test@iZ2513wqj05Z app]$ ll
total 267596drwxr-xr-x  2 root root     4096 Feb 17 17:14 test


提交成功!非常感謝您的反饋,我們會繼續努力做到更好!

這條文檔是否有幫助解決問題?

非常抱歉未能幫助到您。為了給您提供更好的服務,我們很需要您進一步的反饋信息:

在文檔使用中是否遇到以下問題: