linux创建用户,并给予新用户sudo权限

创建用户

[root@wz home]# useradd -g root wz1

密码

[root@wz home]# passwd wz1
Changing password for user wz1.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@wz home]# 

给予sudo权限

[root@wz home]# visudo

在sudo文件里添加%wz1 ALL=(ALL)       ALL

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

%wz1 ALL=(ALL)       ALL

 

 

你可能感兴趣的:(linux)