Day-15 User Management in Linux

#90DaysOfDevOps Linux Series

ยท

2 min read

We discussed Standard Streams and its types with examples yesterday. Today, we'll look at how Linux handles or manages many users. We'll also look at how to modify a user's file permissions.

Linux User Management ๐Ÿ‘จโ€๐Ÿ’ป

User is a concept in Linux that has the ability to change files and carry out various activities. Every OS assigns users a special identifier known as a uid. For the root user uid is 0. There is also concept of user groups in Linux. Let's say your company has several teams, such as a Web development team, a DBMS team, and a DevOps team. What will you do if you want to manage all the users from several teams?

You will make several user groups for these various teams and grant them the rights necessary for their job.

Let's check few commands:

  • pwd: It will show current working directory.I know I covered this in my previous blogs but this is also useful to check current user also.

Screenshot from 2022-10-07 08-37-42.png

Here home is home directory and shivlalsharma is my current working directory which is also my username.

  • sudo : It will grant the user system-wide root access. The root user has superuser level access, allowing him to access, alter, and stop any running process.

Screenshot from 2022-10-07 09-16-27.png

From the image above, we can surmise that some files in the Linux system require root user access in order to view them. By the way, this is a system file called \etc\shadow that holds all of the users' encrypted passwords.

You can use sudo su to create a superuser terminal session if you want to stay in that position for a long time.

  • sudo useradd "name": It will create a new user and add it to the current usergroup.

Screenshot from 2022-10-07 09-34-42.png

Screenshot from 2022-10-07 09-31-56.png

From the image, we added new user shivay in the usergroup. You can cross verify with the help of sudo cat /etc/passwd/.

  • sudo userdel "name": It will delete the user from the usergroup.

Screenshot from 2022-10-07 09-40-16.png

  • sudo passwd name: User can change it's password using this.

Screenshot from 2022-10-07 09-42-44.png

Resources ๐Ÿ“š

Ending Credits ๐Ÿ‘‹

Okay, so today we looked over to the Linux user management and few commands. See you next week with a new Linux topic.

Did you find this article valuable?

Support Comm Blogs by becoming a sponsor. Any amount is appreciated!

ย