How To See Linux Users

Table of contents:

How To See Linux Users
How To See Linux Users

Video: How To See Linux Users

Video: How To See Linux Users
Video: How to list users in Linux 2024, November
Anonim

Linux is a modern fast-growing operating system. It is highly stable and safe. Linux has flexible user management settings and extensive console management capabilities.

How to see linux users
How to see linux users

It is necessary

A computer with a linux operating system

Instructions

Step 1

All user accounts on linux are stored in the text file / etc / passwd. Each line of the file contains information about one of the accounts. It contains 7 fields, separated by colons: 1. Login2. An unused field where the password hash was stored on older systems. 3. User identifier (uid) 4. Primary group id for the account (gid) 5. Personal information about the user, for example, real name and contact numbers. 6. Home directory location 7. Command shell.

Step 2

By default, the / etc / passwd file is readable by any user. You can view the entries in it through a text editor, using console utilities, or a graphical interface.

Step 3

To view linux users directly from this file, simply print its contents to the console with the command: cat / etc / passwd You will see a list of all users registered in the system.

Step 4

User accounts differ in types: 1. Root user, uid = 0.2. System accounts. 3, Regular users. For Red Hat-based systems, they have uid 500 or more, and for Debian-based systems, 1000.

Step 5

In the / etc / passwd file, accounts are not sorted by type, so if you want to list only regular linux users, use filters. For example, this grep command can list only regular users for debian systems by filtering them by uid: cat / etc / passwd | grep -e "^ [^:] *: [^:] *: [0-9] {4,}" Or, adding the cut command to the pipeline, get only their logins and home directories: cat / etc / passwd | grep -e "^ [^:] *: [^:] *: [0-9] {4,}" | cut -d: -f1, 6

Step 6

Besides the file itself and the console utilities, you can get a list of users using graphical programs. For example, the KDE shell contains a user and group management customization module.

Step 7

The top window of the module displays a list of accounts. By clicking on any of them, you will get a description of it at the bottom of the window. The module displays only regular users and root by default, but by checking the corresponding checkbox below the list, you will see system users as well.

Recommended: