User Accounts

[1] Adding a common user account to Future OS and configuring its password, in its simplest form, is as follows:

[[email protected] ~]# useradd future
[[email protected] ~]# passwd future
Changing password for user future.
New UNIX password:              # set password
Retype new UNIX password:       # confirm
passwd: all authentication tokens updated successfully.

or add a user account along with other options.

[[email protected] ~]# useradd -c "Future OS" -d /home/future -m -s /bin/bash future     # -c comment, -d set home directory, -m create home directory, -s set shell
[[email protected] ~]# passwd future
Changing password for user future.
New UNIX password:              # set password
Retype new UNIX password:       # confirm
passwd: all authentication tokens updated successfully.

[2] Make a user (using [future] in this example) a user who can switch to superuser root.

[[email protected] ~]# usermod -a -G wheel future     # -a append, -G group wheel

[3] View user information.

[[email protected] ~]# id
uid=1000(future) gid=1000(future) groups=1000(future),10(wheel)

[4] View all users.

[[email protected] ~]# cat /etc/passwd | grep home
future:x:1000:1000:Future OS:/home/future:/bin/bash

[5] If you'd like to switch to root account from a user added above, use [su] command to do so.

localhost login: future    # input user name
password:                  # input password
[[email protected] ~]$ su   # switch to root
Password:                  # root password
[[email protected] ~]#        # just switched to root account

[6] If you'd like to remove a user accounts, Configure like follows.

[[email protected] ~]# userdel future        # it just removes the user.

or

[[email protected] ~]# userdel -r future     # removes the user along with their home directory.