All commands in this section must be given in an Administrator/root shell!
| Unix Account Management | |
|
View User Accounts |
To view all accounts give the shell command:
cat /etc/shadow
root:!:14994:0:99999:7::: daemon:*:14837:0:99999:7::: nobody:*:14837:0:99999:7::: someuser:$7$jF345tFH$KLFhdf92u3hfs8egdhU894jJkn4nfsKUjkqnAfjiDf66h/Ff9Fjv94sH37/:14994:0:99999:7::: \______/ \_______/\_________________________________________________________/ username salt password hash value Each line contains the password information for every user account on the system. We are only concerned with the first two data fields (separated by a colon) for each line. The first entry in each line is the username and the second is the user's password hash. The long string of random characters is a cryptographic hash of a user's password. If a user accounts has a single asterisk or exclamation point in place of a hash value, then that user cannot log in to the system and pose no security risk. User accounts with password hashes pose as security risks and their need should be evaluated. On server hosts, only the account(s) required to run and administer the server should be allowed to remain. |
|
Remove User Accounts |
To delete the account for user <uname> give the shell command:
sudo deluser <uname>
|
|
Change User Account Passwords |
To change the password for user <uname>,
login as that user and
give the shell command:
passwd
|