ODOT!
Posted on January 30, 2024
Peace,
Linux is an amazing kernel to work with thus far. Learning more and more about the system and each time I think I know something, another topic becomes interesting. Today I wanted to speak about User Management which is quite important if you are a studying for cybersecurity. Why O? Well I learned that if you are running your system as root, it might not be a great idea. Great security practices recommend that you create a sub user that will have 'root' aka 'sudo' privileges. Let's speak on how to work with the user management in detail so you can gain understanding.
First off, let's define what a 'user' is. A 'user' is referred as individuals or entities that interact with the OS by logging in and performing various tasks. There are two types of users as well, System and Regular. A 'System User' is created by the system during installation and are used to run system services and applications. A 'Regular User' is created by the admin and can access the system and it's resources based on their permissions. Yes, you as the admin can make the 'regular user' gain access to certain files on the system which is great! I mean eh, there are those who can be trusted, but may not need ALL the access ya dig?! When users are created there are many properties that make of a such. The properties are the following: User ID, Group ID, Home Directory, Default Shell and Password.
Now that we have that out of the way, let's speak on how to manage these users using a few commands. Remember if you need any assistance when using the commands, always refer to the manual built within Linux.
User Management Commands
Creating a User
useradd <username>
- When using the command you may be prompted to add details to the user. It's a common practice to fill as much as needed for the user as possible. I don't typically fill it out because I'm the sub user who just want my system to be secure.
Delete a User
userdel <username>
See all user accounts on system
sudo nano /etc/passwd
Sudoers file config
sudo nano /etc/sudoers
Change user password
passwd <username>
Give user the sudo (root) privilege
`sudo usermod -aG sudo
Switch users
su - <username>
Add users to a group
`sudo usermod -a -G '
Add users to multiple groups
sudo usermod -a -G group1,group2 username
There are many additional commands to execute user management, but these are just a few to start. Be sure to practice using a regular user with root privileges. This is recommended on just about every cybersec tutorial videos studied and it makes much sense. I'll provide resources for the commands and why user management is important in cybersec.
Until next post.
Peace
Resources
Posted on January 30, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.