When logged in as root (system admin) you can create users using the ‘useradd’ command – along with the desired username – like this:
A prompt would ask for the password of the root or “admin” user – to ensure that it’s a privileged person that is trying to create a new user. After creating the user, you must also create the user’s initial password:
Then a prompt follow where you enter the password you want twice. If the password is not created for a new user the user would be unable to log into the system.
When a new user is created, an entry in the /etc/passwd for the user is created by Linux automatically. Check this by using;
# cat /etc/passwd
The system also creates a directory, labelled with the user’s username in the /home directory. Like in the case above when “alex077” is created, the user’s home directory is /home/alex007 or check with this command;
# ls /home
The command to delete users from the system is the “userdel” command.
# userdel alex007
This removes the user’s entry in the system’s /etc/passwd file.
You could also use;
# userdel –r alex007
Using the –r option removes all the users files and directories automatically or you have to manually delete the files yourself.
- HOW TO INSTALL KDENLIVE VIDEO EDITOR IN LINUX [VIDEO] - September 14, 2020
- Mozilla Launches a Virtual Private Network (VPN) Service - July 31, 2020
- The Second Cohort of #BUILDFORSDG Challenge 2020 is out! - July 24, 2020