9.1 User Management from the Command-line
New users may be added to a Fedora 31 system via the command-line using the useradd utility. To create a new user account, enter a command similar to the following:
# useradd john
By default, this will create a home directory for the user in the /home directory (in this case /home/john). To specify a different home directory, use the -d command-line option when creating the account:
# useradd -d /users/johnsmith john
Once the account has been created, a password needs to be assigned using the passwd tool before the user will be able to log into the system:
# passwd john
Changing password for user john.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
An existing user may be deleted via the command-line using the userdel utility:
# userdel john
It is also possible to remove the user’s home directory and mail spool as part of the deletion process:
# userdel...