How to View System Users in Ubuntu Linux

October 21, 2024 / Tutorial

This article explains how to view system users in Ubuntu Linux VPS. In Ubuntu Linux, viewing system users is a straightforward process that can be done using various commands in the terminal.

Whether you need to manage user accounts or ensure security, knowing how to see system users is essential.

Here’s how you can do it:
  1. Using the ‘/etc/passwd’ File: The /etc/passwd file embodies information about all system users. You can view the users by running the following command:cat /etc/passwdThis command will display a list of users along with their details. Each line represents a user and includes information such as username, user ID, group ID, home directory, and the shell used.
  2. Using the ‘getent’ Command: Another way to see the system users is by employing the ‘getent’ command, which recovers entries from the administrative databases. To list users, run:getent passwdThis command offers similar information as the /etc/passwd file but can also comprise network users if configured.
  3. Using the ‘cut’ Command for a Clean List: If you want to display only the usernames without additional details, you can combine the cut command with the previous commands:cut -d: -f1 /etc/passwdor

    getent passwd | cut -d: -f1

    Both commands will give you a clean list of usernames on your system.

  4. Checking Logged-in Users: To see users currently logged into the system, you can use the ‘who’ or ‘w’ commands:Whoor

    W

    These commands offer information about users presently logged in, embodying their terminal, login time, and activity.

  5. Using the ‘id’ Command for Specific Users: If you want to get details about an exact user, the ‘id’ command can be helpful. For example:id usernameThis command will show you the user ID, group ID, and the groups the user belongs to.

Being able to view system users on your Ubuntu Linux VPS is important for management and security. By using the commands outlined above, you can easily monitor user accounts and ensure your system is secure. If you have any further questions or need assistance, feel free to reach out to our support team.

Read Also: How to Install and Uninstall VS Code Using APT on Ubuntu.

Leave a Reply

Your email address will not be published. Required fields are marked *