Linux creates users, user groups and grants permissions

The specific execution shell statement is as follows:

###删除用户:完整的删除系统用户
userdel -r hadoop

useradd -d /home/hadoop hadoop
echo hadoop:'DkLB9vUj' |chpasswd
或则echo DkLB9vUj|passwd --stdin hadoop
●将hadoop加入wheel组
usermod -G wheel hadoop     
●配置wheel组用户sudo 操作、免密权限等
chmod +w /etc/sudoers
sed -i "s/# %wheel/%wheel/g" /etc/sudoers
chmod -w /etc/sudoers
●完成以上步骤就可以实现从当前用户登录面密登录到root用户
●使其普通用户能够使用docker命令
usermod -G wheel,docker hadoop

Guess you like

Origin blog.csdn.net/weixin_42039228/article/details/131732303