1. 程式人生 > >ubuntu 如何新增 sudo許可權

ubuntu 如何新增 sudo許可權

今天在使用IT幫忙裝的新的Ubuntu的時候發現,竟然sudo都用不了;

很是讓我氣憤:

[email protected]:sudo apt-get install SL

提示:

[sudo] password for xxx:

xxx is not in the sudoers file.This incident will be reported.

找谷大哥了一下,發現linux預設沒有為當前使用者開啟sudo許可權!

下面我來說一下我新增的方法:

step1:切換到root使用者;

su

step2:修改/etc/sudoers 檔案編寫許可權:

chmod u+w /etc/sudoers

step3:編譯改檔案:

vi /etc/sudoers

將:

xxx ALL=(ALL) ALL 加入其中:

step4:

還原/etc/sudoers 檔案編寫許可權,並推出:

chomd u-w  /etc/sudoers

exit;

之後就可以sudo了;

另外,誰知道怎麼在csdn裡面插入Shell指令碼語言?就是在插入程式碼裡面,新增一個shell 語言類?