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