Linux user management
==Summary== Basic user creation and account manipulation is relatively easy with a number of simple commands
{| class="wikitable"
!Command
!Purpose
!Syntax Use
|-
|adduser||Creates a user account|| adduser
==File Locations== Linux stores its user account and password hashes in two seperate files located on the file system.
The /etc/passwd
file stores all of the user accounts on the system
The /etc/shadow
file stores all of the hashes of the passwords to each account on the system
==Commands==
===adduser===
adduser
adds a user to the system. This user account though is unaccessible as no password has been assigned to it, but can be identified as a valid user through ssh login or virtual login when logging into linux in non-gui mode. Note this step will create the user accounts home directory under /home/
Create a user by entering:
Creating a user who also has sudo capabilities can be done simply by entering:
===passwd=== After adding a user, you should immediately add a password, thus giving access to the account
Add a user by entering:
You will then be prompted to enter a password and possibly warned if it is not strong enough, you can choose to ignore this warning if you would like
===userdel===
userdel
will delete the user's account but does not delete any of the user's data or content stored in their home folder. This function acts as a method of disabling the user account.
To disable/delete a user account enter:
To fully delete an account you will need to delete the user's data folder in /home/<username
This can be done cautiously with the following command
Note we are using the remove function but also have navigated to the /home
folder. All we are doing here is forcing and recursively deleting the user's data folder from the /home
folder
Alternatively, userdel can also be used to remove users from groups. You can list all groups a user is in with the following command
==Notes==
==Sources==