junxnone / linux

Linux wiki
https://junxnone.github.io/linux/
0 stars 0 forks source link

Ubuntu UserAdd #104

Open junxnone opened 5 years ago

junxnone commented 5 years ago

添加用户

UseCase

Usecase cmd
Create new user with home folder sudo useradd -r -m -s /bin/bash gpu
-m 创建用户目录在 /home/gpu
指定目录为用户名主目录 usermod -d /home/xx/gpu gpu
添加用户到某个group sudo usermod -aG guestgroup username

为用户添加 root 权限

chmod +w /etc/sudoers 
vi /etc/sudoers 

添加如下内容:

gpu ALL=(ALL:ALL) ALL
sudo usermod -a -G sudo newuser

Issues

Reference