Manage user accounts at the command line in Linux
This lesson covers various aspects of managing users at the command line in Linux.
List the users on your Linux server at the command line
To list the users on your Linux server at the command line, type the following:
This will give you a list of all users on the Linux server along with additional detail. Note that it will list system users as well as "regular" users. To veew just the regular users on the server, you can type the following:
cat /etc/passwd |grep 500*
You can tweak this slightly to show only the user names and none of the additional detail using the following command:
cat /etc/passwd | grep 500* | cut -d":" -f1
Change your password in Linux at the command line
To change your password at the command line, type the following:
You will then be prompted to enter the old password (unless you are logged in with root privileges), the new password, and then the new password again. You will then see a message confirming the change was made successfully.
You can change the password for another user (if you have privileges to do so) by typing:
This time you will only be prompted to enter the new password twice.