cat /etc/passwd
/etc/sudoers
sudo useradd -m -g initial_group -G additional_groups -s login_shell username
Create the user's home directory if it does not exist. The files and directories contained in the skeleton directory (which can be defined with the -k option) will be copied to the home directory.
By default, if this option is not specified and CREATE_HOME is not enabled, no home directories are created.
sudo userdel -r username
usermod -u <NEWUID> <LOGIN> groupmod -g <NEWGID> <GROUP> find / -user <OLDUID> -exec chown -h <NEWUID> {} \; find / -group <OLDGID> -exec chgrp -h <NEWGID> {} \; usermod -g <NEWGID> <LOGIN>
Chaque utilisateur est membre d'un ou plusieurs groupes.
cat /etc/group
getent group groupname
sudo groupadd group
sudo groupmod -n new_group old_group
sudo groupdel group
groups username
En plus détaillé :
id username
sudo usermod -g <primary_group> <user>
sudo usermod -a -G <additional_groups> <user>
-G : Each group is separated from the next by a comma, with no intervening whitespace.
sudo gpasswd -d user group
sudo mkdir /home/public sudo /usr/sbin/groupadd share sudo chown -R root.share /home/public sudo /usr/bin/gpasswd -a user1 share sudo chmod ug+rwx -R /home/public # set the SGID bit on the shared directory. Normally whenever you create files in a directory, by default it belongs to the default group or user. When a file is created in a directory with the SGID bit set it belongs to the same group as the directory. The result being that all users of the “share” group can create/alter files in “/home/public” directory. sudo chmod g+s /home/public
remove user from sudoers group
sudo deluser <username> sudo