1、直接增加到wheel用户组

usermod -a -G wheel username

2、编辑/etc/sudoers文件增加

echo "username    ALL=(ALL)       ALL" >> /etc/sudoers

3、自己新建一个用户,并以组的形式增加到/etc/sudoers文件中,最后再增加另一个用户到这个组上

useradd sudogroup
echo "%sudogroup    ALL=(ALL)       ALL" >> /etc/sudoers
useradd abc
usermod -aG sudogroup abc

亮点:%这个符号就是代表一个用户组

 

参考:

https://unix.stackexchange.com/questions/370400/cant-add-user-to-sudo-group-in-centos-7-i386no-gui-its-minimal

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2021-06-23
猜你喜欢
  • 2022-12-23
  • 2021-07-20
  • 2021-11-01
  • 2021-11-06
  • 2021-08-23
  • 2021-11-30
相关资源
相似解决方案