CentOS為用戶增加root權限


1.修改 /etc/sudoers 

vi /etc/sudoers 

在下邊增加一行內容

root    ALL=(ALL)     ALL
username   ALL=(ALL)     ALL

 

2.去掉注釋

%wheel    ALL=(ALL)    ALL

保存退出

 

usermod -g root username

 

3.修改 /etc/passwd 文件

vi /etc/passwd

 

username:x:500:0:username:/home/username:/bin/bash

改為

username:x:0:0:username:/home/username:/bin/bash

 

 

重啟系統

reboot


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM