Managing users: useradd, usermod, passwd, groupadd and sudo
Sign in to read this lesson
A new admin joins the team, a project needs a shared group, a leaving employee's access must be closed. In this lesson we learn to create users, add them to groups, lock accounts and manage who has sudo rights.
What you will learn
sudo useradd -m -s /bin/bash namecreates a user with a home directory and shell;sudo passwd namesets the password.- On Ubuntu
adduseris the interactive, more convenient option. sudo usermod -aG group nameadds the user to a supplementary group; without-athe old groups are removed.sudo usermod -L namelocks the account,sudo userdel -r namedeletes it together with the home directory.- sudo rights come from the
sudogroup or files in/etc/sudoers.d/; edit them only withvisudo.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.