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

相关文章:

  • 2021-07-07
  • 2022-12-23
  • 2021-07-28
  • 2021-11-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2021-08-12
  • 2021-12-07
  • 2021-07-01
相关资源
相似解决方案