DEV Community

Cover image for Manage Those Users
ODOT!
ODOT!

Posted on

1

Manage Those Users

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

User Management

Don't use Root as a User if Possible

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay