Modifying user settings isn’t something I do everyday but it is necessary occasionally
You can add a user with the ==useradd== command
sudo useradd -m -s /bin/bash Ted
The command adove does several things. It adds a user named Ted. additionally the -m option automatically creates the users home directory structure and the -s option sets the shell to be used. In this case to bash.
==usermod== is useful for working on a current users priveleges.
The most common use I have for it is adding my user to a group for
additional priveleges
make sure to use the -a or you will remove them from other groups
usermod -a -G groupname username
For example we want to add Ted to the foo group
usermod -a -G foo Ted\
You can see all the available usergroups in your /etc/group fiile
Other usermod functions:
1 Change a users primary group
usermod -g groupname username
usermod -e YYYY-MM-DD username
this is useful if you want a friend to have temporary access to your machine
usermod -d filepath username
usermod -l newusername currentusername
usermod -L username
To unlock them
usermod -U username
usermod -s shell path username
for example
usermod -s /bin/bash Ted
will set teds shell to bash
Associated command to usermod
==id username==
will give you info on the user such as uuid groups etc.
list all users on the system
cut -d: -f1 /etc/passwd
View recent login history for a user
last username ```