27 julio, 2024

Managing users and groups in Linux

The Linux operating system has a great user and group management capacity allowing you to make optimal use of your multi-user platform. Those who use this server are identified by a Usernameand must also have a password so you can perform credential verification and access the system. Furthermore, access to certain files, directories and files will depend on the groups to which the user belongs of the Linux system or users.

User types on Linux

In systems that are based on the GNU/Linux or Unix interface, there are two types of Linux users: the administrator or rootand the other users:

Administator: linux users root has the possibility of rCarry out all types of tasks regarding administration of the system. Changes or modifications made with this user can cause problems in system security complete, so we must take into account recommendations such as use this root only when strictly necessaryor carry out an administration task, and when we are finished, we must return to working with our normal user. Additionally, it is suggested that to access the administrator user, you must first log in through a normal user account, this measure prevents working with root by default.
Other users: The other types of normal or non-administrative Linux users are those who can use the system tools normally, but who They cannot perform administrative tasks.

To be able to change from normal user to user root, administration permissions will be neededand can be accessed either providing the user’s password root and logging in, or set a list of users who can have administrator access. In terms of security, it is advisable to opt for the second option, because sharing the user’s password root with several people, involves the transfer of sensitive information and puts the system in a vulnerable situation.

Groups in Linux

Groups in Linux are mainly used to grant permissions on files and directories, that is, for Linux user management. The operating system already includes certain default groups that fulfill specific functions. Each group created in Linux has the characteristic of be independent from others. Additionally, groups on Linux can have passwords. These groups can be primary or secondary for managing Linux users:

Main group: Its function is to determine who will be the group that owns the files created by the user. The primary group is the one It is associated with the account by default, and to which the files and directories developed by the user will be assigned. Also, the group name is usually the same username.
Secondary groups: Supplementary groups are those additional groups to which the user belongs.

Commands for managing users and groups in Linux

Some commands for managing Linux users are:

adduser either useradd: allows the creation of new users, that is, the administration of Linux users.
usermod, chfn, chsh and chage: used for the modification of a user.
deluser either userdel: command for deleting users.
passwd– to change a user’s password.
addgroup either groupadd: used to add a group in user and group management.
groupmod: allows you to modify a group.
groupdel either delgroup– Used to delete a group.
gpasswd: command designed to change the password of a group.
whoami: to know which user we are.
groups: to obtain information about the groups to which we belong.
id: shows us both the user and the groups for the administration of Linux users.
his: command to change user.
quien either w: Used to know which users are connected to the machine at a certain time.
write either wall: to send messages to other logged in users.

Each and every one of these commands is part of Linux user administration.

What is the next step?

Now that you have learned about managing users and groups in Linux, their classification and main commands, Do not hesitate to continue training yourself about this and other topics through our DevOps & Cloud Computing Full Stack Bootcampwhere in less than 6 months you will have all the necessary tools to become an expert in these topics and improve the life cycle of your projects software or technology development.

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *