Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
04-linux:10-administration:88-users [2016/11/14 18:40] – Roge | 04-linux:10-administration:88-users [2023/03/05 02:15] (Version actuelle) – [Partage dossier entre utilisateurs] Roge | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ====== Users ====== | ||
+ | |||
+ | références : https:// | ||
+ | |||
+ | |||
+ | ===== Utilisateurs ===== | ||
+ | |||
+ | |||
+ | * Liste des utilisateurs : | ||
+ | |||
+ | '' | ||
+ | |||
+ | * Liste des sudoers : | ||
+ | |||
+ | ''/ | ||
+ | |||
+ | * Ajout d'un utilisateur : | ||
+ | |||
+ | '' | ||
+ | |||
+ | <note important> | ||
+ | //**-m, %%-%%-create-home**// | ||
+ | |||
+ | 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. | ||
+ | </ | ||
+ | |||
+ | * Suppression d'un utilisateur : | ||
+ | |||
+ | '' | ||
+ | |||
+ | <note important> | ||
+ | The //**-r**// option specifies that the user's home directory and mail spool should also be deleted. | ||
+ | </ | ||
+ | |||
+ | |||
+ | * Modification des UIDs et GIDs | ||
+ | |||
+ | <code bash> | ||
+ | usermod -u < | ||
+ | groupmod -g < | ||
+ | find / -user < | ||
+ | find / -group < | ||
+ | usermod -g < | ||
+ | </ | ||
+ | |||
+ | ===== Groupes ===== | ||
+ | |||
+ | Chaque utilisateur est membre d'un ou plusieurs groupes. | ||
+ | |||
+ | |||
+ | * Liste des groupes : | ||
+ | |||
+ | '' | ||
+ | |||
+ | * Membres d'un groupe : | ||
+ | |||
+ | '' | ||
+ | |||
+ | * Création d'un groupe : | ||
+ | |||
+ | '' | ||
+ | |||
+ | * Modification d'un nom de groupe : | ||
+ | |||
+ | '' | ||
+ | |||
+ | * Suppression d'un groupe : | ||
+ | |||
+ | '' | ||
+ | |||
+ | * Groupes d'un utilisateur : | ||
+ | |||
+ | '' | ||
+ | |||
+ | En plus détaillé : | ||
+ | |||
+ | '' | ||
+ | |||
+ | |||
+ | * Changement du groupe **primaire** d'un utilisateur | ||
+ | |||
+ | '' | ||
+ | |||
+ | * Ajout d'un utilisateur à un groupe (groupe secondaire de l' | ||
+ | |||
+ | '' | ||
+ | |||
+ | |||
+ | <note warning> | ||
+ | If the //**-a**// option is omitted in the usermod command above, the user is removed from all groups not listed in additional_groups (i.e. the user will be member only of those groups listed in additional_groups). | ||
+ | |||
+ | //**-G**// : Each group is separated from the next by a comma, with no intervening whitespace. | ||
+ | </ | ||
+ | |||
+ | * Suppression d'un utilisateur d'un groupe : | ||
+ | |||
+ | '' | ||
+ | |||
+ | |||
+ | ===== Partage dossier entre utilisateurs ===== | ||
+ | |||
+ | < | ||
+ | sudo mkdir / | ||
+ | |||
+ | sudo / | ||
+ | |||
+ | sudo chown -R root.share / | ||
+ | |||
+ | sudo / | ||
+ | |||
+ | sudo chmod ug+rwx -R / | ||
+ | |||
+ | # 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/ | ||
+ | |||
+ | sudo chmod g+s / | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Sudoers ===== | ||
+ | |||
+ | |||
+ | remove user from sudoers group | ||
+ | '' |