Today, Linux is considered one of the most powerful operating systems, since has excellent prospects for the future. This, mainly, it is characterized by being a free software, as well as a multi-user and multi-tasking system that offers a command interface and a graphical interface. What’s more, is distinguished by being robust, independent, safe and easily adaptable.
Among other peculiarities, Linux has captured the attention of millions of people for its powerful user and group permission management. Taking into account that, by default, this operating system focuses on sectioning each user depending on the group to which it belongs, in order to grant free access to certain directories, files, peripherals, etc.
For this reason, user management in Linux it is an essential factor both when adding, changing or delete users, as well as to manage these correctly in order to ensure safety. But luckily, to simplify user management, the OS provides numerous commands that are useful and here, you will know what they are.
What are Linux user management commands and what are they for?
Basically, Linux commands are defined as an instruction that tells the operating system what task to perform. Therefore, they consist of certain commands that Linux uses to execute certain actions through the command line or from a terminal. Whereas, said interface or terminal is a program that allows you to easily execute commands.
Now, the commands for Linux user management refer to all those actions that are executed with the aim of creating, modifying or deleting users. As for create, change or delete groups and add or remove users from a certain group. Apart from that, they are essential when changing the password of a certain user. For its part, this administration is so important because Linux identifies various types of users, according to the group to which they belong.
That is why, it is worth knowing what are the user classes that this operating system distinguishes and, below, we detail each of them:
It is also known as “administrator” or “Super user” and it stands out for being the only user account that has privileges throughout the entire system. Default, his “User ID” is zero (0). Under this feature, the root user has the ability to perform system maintenance tasks, control the account management of other users, enter all directories and files regardless of permissions and owners. Like, install software on the system, modify drivers, stop the system, etc..
They are called “System accounts” and they assume some root privileges, depending on the account. These are usually assigned a User ID no way from 1 to 100 and it is created at the time of Linux installation, automatically. By default, special Linux users do not have passwords because they are accounts that are not specially designed to log in with. In view of this, They are also known as “nologin” or “no login” accounts..
All individual users make use of this type of user account in the system. From her, each person you can have your own working directory and, in addition, you will have the option to customize your work environment just the way you want.
Regarding their privileges, we highlight that these users they only have full permissions on their working directory and in effect, they cannot take any action on the accounts of other people. In that sense, in current Linux distros, normal users a User ID greater than 500 is established for them.
Know the best commands that exist to manage users in LinuX
Even if Linux supports manual ways to create and manage users on the system, the truth is that it is more effective to carry it out via commands run on the Linux console. Through these commands, it will be simpler to create, change or delete users, as well as manage your options and other actions of interest.
Next, we list these essential commands to manage users in Linux:
adduser Takes care of add users to the system, requesting your main data and a password. Also, it manages to add an existing user to a group that has also been set in the OS. adduser [opciones] Username
adduser [opciones] user group
useradd This allows adding users using particular information of each person, as parameters. Also, a password must be established. useradd [opciones] user addgroup If you need add a group to the system, this is the command you have to use. addgroup group groupdel Used to delete a group. To do this, it is necessary to assess that a group that is applied to a user as a primary group cannot be deleted. group from group groupmod With the help of this command, users will be able to modify a group that has been previously created. groupmod [opciones] group usermod Handles modify or change the parameters of an already created user. usermod [opciones] user userdel This is useful for delete any user. userdel [opciones] user deluser To remove a user from a specific group, it is recommended to use this command. sudo deluser -r user group passwd It is an instruction used to add or change a user’s password that already exists. To confirm this password, it will be requested twice by passwd user pwck
Check the consistency of the / etc / passwd and / etc / shadow files to store the encrypted password and manage other password control fields. / etc / passwd
/ etc / shadow
chown It is the one that allows changing the owner and also the group simultaneously. sudo chown user document.txt (to assign owner)
sudo chown user: office (to set owner and group)
chsh It is a command that is used so that a user can change your own shell, default. chsh [OPCIONES] USERNAME
chage Ideal for change or set password check date parameters. chage -E 2021-12-31 “Username” chpasswd Generally used in conjunction with newusers and deals with set or update passwords in batch mode multiple users at the same time. # chpasswd gpasswd Achieve manage group passwords (/ etc / group and / etc / gshadow) gpasswd [opcion] Newusers East GROUP update or create users in batch mode, of many users at the same time. (used in conjunction with chpasswd). newusers [filename]
newgrp is a command that allows users to change your group ID no need to log out and log in again. newgrp [-] [GRUPO]
id is informative because shows the identity of the user (UID) and the groups to which it belongs. go [OPCIONES] [USUARIO]
Set shadow protection (/ etc / shadow) to the / etc / passwd file and also converts normal password files to hidden password files. / etc / pwconv pwunconv It is opposite of the above and basically remove shadow protection (/ etc / shadow) to the / etc / passwd file. / etc / pwunconv chfn Handles modify finger information, comment field. chfn [OPCIÓN “NUEVO VALOR”] [USUARIO]
vipw It is simply a command that edit the / etc / passwd file. vipw-s vigr This one focuses on edit the / etc / group file. vigr – s
If you have any questions, leave them in the comments, we will answer you as soon as possible, and it will surely be of great help to more members of the community. Thanks! 😉