One of the features of multi-userOperating systems, which include 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 typing a special sequence of characters. This solution is the simplest and does not require the use of special skills.
Any person who uses a computer andmeans OS, 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 set up accounts to differentiate access to files, directories and peripherals.
How to solve the problem of the withdrawal of existing accounts? In the Linux system, the user list 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 are 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 (user name): password (password stored in encrypted form): UID (unique ID): GID (main user group ID): GECOS (additional information): directory (user directory): shell (command interpreter used).
The above command allows you to outputThe list of 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.