ComputersOS

How do I list users on Linux?

One of the features of multi-user operating systems, which includes Linux, is the possibility of using it by different people. Usually, each of them has a separate account. In Linux, you can see the list of users using the command interpreter by entering a special sequence of characters. This solution is the simplest and does not require the use of special skills.

Who is the user of the system

Any person who uses a computer and OS facilities can be considered a user. He is assigned a certain unique name (otherwise not allowed), which can include Latin letters, Arabic numerals, "_" and "." Symbols. Any user has a separate directory. It comes to him after authorization. There are a number of personal files and folders. Usually, user directories are in the / home directory. The OS administrator can configure accounts to differentiate access to files, directories and peripherals.

How to list users on Linux

How to solve the problem of the withdrawal of existing accounts? In the Linux system, a list of users is displayed with a command (it is allowed to use different parameters):

# Cat / etc / passwd

Why does this work? The fact is that all the necessary data contains the file / etc / passwd. To him directly and drawn an accountant interested in people. After specifying the command, a list of Linux accounts is displayed. The list of users in the system can be quite extensive. Data about available accounts is displayed line by line.

How can it look on the screen? Each line will be about the following:

Root: xD634Jhs5jH32: 0: 0: root: / root: / bin / bashnewuser: Xv7Q641g89oKK: 1000: 100: Ivan Fedorov: / home / newuser: / bin / bash

Explanation:

Account: password (password stored in encrypted form): UID (unique ID ): GID (user principal user ID): GECOS (additional information): directory (user directory): shell (command interpreter used).

View active accounts

The above command allows you to list all users registered in the system. But what if you need to display a list of users on Linux that are active right now? To do this, you can use the following command:

# Who

By typing this manual, a person will be able to see a list of active accounts in the system. In this case, the Linux user list Is also performed line by line. Having administrative authority, you can make various manipulations with active accounts. So, you can give people access to certain files or folders, restrict the use of certain programs.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.delachieve.com. Theme powered by WordPress.