学习sudo遇到的问题

[root@Beiqi ~]# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)

 

[root@Beiqi ~]# visudo
## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL

beiqi   ALL=/usr/sbin/useradd

beiqi   ALL=/usr/bin/passwd



## Allows members of the 'sys' group to run networking, software,
## service management apps and more.
# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS

## Allows people in group wheel to run all commands
%wheel  ALL=(ALL)       ALL

## Same thing without a password
# %wheel        ALL=(ALL)       NOPASSWD: ALL

切换到beiqi,输入beiqi密码成功则执行命令

[beiqi@Beiqi ~]$ sudo useradd qer
[sudo] beiqi 的密码:
[beiqi@Beiqi ~]$ ls /home
beiqi  gzd  mysql  qer

 

你可能感兴趣的:(学习sudo遇到的问题)