Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
Changing    password    for user    sandra.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

Enter the new password twice. If you do not create an initial password for a
new user, the user cannot log in.


The adduser command has many command-line options. The command
can be used to set policies and dates for the new user’s password, assign a
login shell, assign group membership, and other aspects of a user’s account.
See man adduser as well as Chapter 13, “Managing Users,” for more info.


Deleting Users


Use the deluser command to delete users from your system. This
command removes a user’s entry in the system’s /etc/passwd file. You
should also use the command’s —remove-all-files and —remove-
home options to remove all the user’s files and directories (such as the user’s
mail spool file under /var/spool/mail):


Click here to view code image
matthew@seymour:~$ sudo deluser --remove-all-files --remove-home
andrew


If you do not use the -remove-home option, you have to manually delete
the user’s directory under /home, along with the user’s
/var/spool/mail queue.


Shutting Down the System


Use the shutdown command to shut down your system. The shutdown
command has a number of different command-line options (such as shutting
down at a predetermined time), but the fastest way to cleanly shut down
Linux is to use the -h (or halt) option, followed by the word now:


Click here to view code image
matthew@seymour:~$ sudo shutdown -h now


You can also follow -h with the numeral zero ( 0 ), like this, to get the same
effect:


Click here to view code image
matthew@seymour:~$ sudo shutdown -h 0

Free download pdf