打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
添加用户到 wheel 组 debian

debian

1. useradd -m xyz m 表示在 home 下创建相应的用户目录。

2. passwd xyz

3. usermod -a -G wheel xyz

如果出现错误提示,那么需要 usermod: group 'wheel' does not exist, 需要 addgroup wheel
参考: https://superuser.com/questions/716636/i-cant-add-a-user-to-the-wheel-group/716637

4. vi /etc/pam.d/su

auth       required   pam_wheel.so

5. vi /etc/login/refs

SU_WHEEL_ONLY yes

参考: https://blog.csdn.net/cbbbc/article/details/51712913

6. apt-get update, apt install sudo 安装 sudo

chmod u+w /etc/sudoers
vi /etc/sudoers
chmod u-w /etc/sudoers

%wheel  ALL=(ALL:ALL) ALL

参考: https://blog.csdn.net/xiaotengyi2012/article/details/7340822

7. 创建用户后,可能出现 tab 按键不能使用的问题。

vi /etc/passwd,找到用户名对应的哪一行, 把 sh 改为 bash
参考: https://blog.csdn.net/rzhzhz/article/details/7573201
https://www.cnblogs.com/klobohyz/archive/2011/12/22/2297392.html

centos

useradd xyz
passwd xyz
usermod -aG wheel xyz

参考: https://phoenixnap.com/kb/how-to-create-add-sudo-user-centos

ubuntu

adduser -m xyz
ls /home
passwd xyz
usermod -aG sudo xyz

参考: https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-16-04

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
linux系列之debian sudo
sudo配置文件/etc/sudoers浅析
UBUNTU中SUDO使用说明
Linux 命令 su 和 sudo 的区别?
centos7下php设置用户和组,Centos7学习之添加用户和用户组的方法
Ubuntu 16.04 安装ftp服务器传输文件
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服