Outils du site

La prévision est difficile surtout lorsqu'elle concerne l'avenir. [P. Dac]

04-linux:10-administration:88-users

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
04-linux:10-administration:88-users [2016/11/16 00:46] – [Utilisateurs] Roge04-linux:10-administration:88-users [2023/03/05 02:15] (Version actuelle) – [Partage dossier entre utilisateurs] Roge
Ligne 1: Ligne 1:
-====== Utilisateurs ======+====== Users ======
  
  
Ligne 80: Ligne 80:
 ''id //username//'' ''id //username//''
  
-  * Définition des groupes d'un utilisateur : 
  
-''sudo usermod -a -G //additional_groups// //username//''+  * Changement du groupe **primaire** d'un utilisateur
  
 +''sudo usermod -g //<primary_group>// //<user>//''
 +
 +  * Ajout d'un utilisateur à un groupe (groupe secondaire de l'utilisateur)
 +
 +''sudo usermod -a -G //<additional_groups>// //<user>// ''
 +
 + 
 <note warning> <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). 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).
Ligne 95: Ligne 101:
  
  
 +===== Partage dossier entre utilisateurs =====
 +
 +<code>
 +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
 +</code>
 +
 +
 +
 +===== Sudoers =====
 +
 +
 +remove user from sudoers group
 +''sudo deluser <username> sudo''
Dernière modification : 2017/10/06 23:40