$> useradd -m -d /home/toto -u 1001 -g 11 -c “Comment" -s /bin/zsh gautier
-m
: create home dir
To see defaults useradd -D
Create group
$> groupadd gautier -g 11
List group
$> getent group
Add user to group
$> usermod -aG wheel gautier
Password change:
$> passwd gautier
$> echo "1234" | passwd --stdin "gautier"
$> echo "gautier:1234" | chpasswd
Change owner
chown -R user:group file.txt
Change default shell
$> chsh -s /bin/zsh
/etc/skel vipw /etc/default/useradd /etc/login.defs chage -l gautier passwd -S gautier
getent passwd
su : substitue user mais garde l'env de depart su - : charge l'env de l'utilisateur