Ici sur le forum https://hyliatyde.space/forum/viewtopic.php?pid=19474#p19474
adduser
Répondez aux questions qui vous sont posées.
Par exemple
[root@trueos] ~# adduser Username: mimi2 Full name: mimi2 Uid (Leave empty for default): Login group [mimi2]: Login group is mimi2. Invite mimi2 into other groups? []: wheel Login class [default]: Shell (sh csh tcsh git-shell bash rbash nologin) [sh]: Home directory [/home/mimi2]: Home directory permissions (Leave empty for default): Use password-based authentication? [yes]: Use an empty password? (yes/no) [no]: Use a random password? (yes/no) [no]: Enter password: Enter password again: Lock out the account after creation? [no]: Username : mimi2 Password : ***** Full Name : mimi2 Uid : 1002 Class : Groups : mimi2 wheel Home : /home/mimi2 Home Mode : Shell : /bin/sh Locked : no OK? (yes/no): yes adduser: INFO: Successfully added (mimi2) to the user database. Add another user? (yes/no): no Goodbye!
Avec la commande chpass <nom de l'utilisateur>
Exemple
chpass mimi2
L'éditeur qui s'ouvre est vi
Un lien pour se familiariser avec l'utilisation de vi http://wiki.linux-france.org/wiki/Utilisation_de_vi
Dans mon exemple, je veux changer mimi2 en mimi3.
Je me suis placée sur le 2 de chaque ligne à modifier avec le curseur et j'ai tapé r3 pour remplacer le 2 par le 3
#Changing user information for mimi2. Login: mimi3 Password: $6$TpyDVb/ogv.ITg2N$UWaB9FLUwi2fzwBE89FIGhNbjE8DS5fImc94oxYaz0.2sOf1di9DM6KTavZ5/rPiHC6yxmbblcSihMzJGOJ8z1 Uid [#]: 1002 Gid [# or name]: 1003 Change [month day year]: Expire [month day year]: Class: Home directory: /home/mimi3 Shell: /bin/csh Full Name: mimi3 Office Location: Office Phone: Home Phone: Other information: ~ ~ ~ ~ ~ ~ ~ ~ /etc/pw.2ftleb: unmodified: line 1
Lignes concernées
Login: mimi3 Home directory: /home/mimi3 Full Name: mimi3
sauvegarder et quitter avec :w
En cas de fausse manoeuvre, si vous voulez quitter vi sans sauvegarder :q
Avec rmuser
Exemple
rmuser mimi2
Retour
Matching password entry: mimi2:$6$fB6amfDtfDbFlBSK$aWG9Oep.FMYcmMNBB2DQfOdyWc6tuMhmLSnc2TrZXK15v/Nv/lZUvz9VFiyIfMoahcPJlhrx6m97w524YwWrP0:1002:1003::0:0:mimi2:/home/mimi2:/bin/sh Is this the entry you wish to remove? yes Remove user's home directory (/home/mimi2)? yes Removing user (mimi2): files(4) mailspool home passwd.
Voilà, supprimée mimi2