Linux user management LLTV crash course

To add a new user

sudo useradd username

In order to understand users, first lets have a look at the current users in the system

ls -l /home

In order to see all users, you have to go to the file /etc/passwd. So lets do that:

cat /etc/passwd

If you want to count the users, simply use wc -l

cat /etc/passwd | wc -l

If you want to seek for a particular user you can do it with grep:

cat /etc/passwd | grep {username} cat /etc/default/useradd USE THIS CAREFULLY THERE IS NO GOING BACK sudo userdel {username} sudo useradd -m {username} sudo userdel -r {username} sudo useradd -m {username} sudo passwd {username} sudo useradd -r {sysuser}