How to add/delete users?
Add user
Creating users let you :
- Get a login for ssh access
- Create a new mail address
- Split privileges
- ...
According to the user's taks, you won't create the account the same way.
- Leave defaults for an user with SSH access
- You can add an user to a group to manage groups permissions for multiple user at once.
- You can set a fake shell if you want to disable shell access for an user : "/sbin/nologin".
To add an user, use "adduser". It is interactive istead of "useradd". Yeah, I know...
That's how it looks like :
root@votreserveur[~] # adduser Use option ``-silent'' if you don't want to see all warnings and questions. Reading /etc/shells Check /etc/master.passwd Check /etc/group Ok, let's go. Don't worry about mistakes. There will be a chance later to correct any input. Enter username []: toto Enter full name []: Jean-Eudes Enter shell csh ksh nologin sh [nologin]: nologin Uid [1005]: Login group toto [toto]: Login group is ``toto''. Invite toto into other groups: guest no [no]: Login class authpf bgpd daemon default dovecot pbuild staff unwind [default]: Enter password []: Enter password again []: Name: toto Password: *************** Fullname: Jean-Eudes Uid: 1005 Gid: 1005 (toto) Groups: toto Login Class: default HOME: /home/toto Shell: /sbin/nologin OK? (y/n) [y]: y Added user ``toto'' Add another user? (y/n) [y]: n Goodbye!
Make sure to set a good passphrase.
Delete an user
# userdel toto # groupdel toto
Here you go! 😊