Creating, modifying, and deleting local user accounts and groups
One of the first tasks that a system administrator has to do when preparing a system to be accessed by users is to create new user accounts for the people accessing the system. In this section, we will review how local accounts are created and deleted, as well as how they are assigned to groups.
The first step is to create a new user account in the system. That is done by using the useradd
command. Let's add user01
to the system by running the following:
[root@rhel8 ~]# useradd user01 [root@rhel8 ~]# grep user01 /etc/passwd user01:x:1001:1001::/home/user01:/bin/bash [root@rhel8 ~]# id user01 uid=1001(user01) gid=1001(user01) groups=1001(user01)
With that, the user is created.
Important note
To be able to add users, we need administrative privileges. In the current configuration, we do that by running the commands as root
.
The account is created using the default options configured in the system...