Linux learning (CentOS-7)---Login and logout of Linux system

Abstract: Linux is a multi-user operating system. To use the system, users must first log in to the system, and after using the system, they must log out of the system. When a user logs in to the system, in order to enable the system to identify himself, he must enter a user name and password, and can enter the system only after the system has verified that it is correct. Two kinds of accounts can be created during system installation: 1. root – super user account, which can be used to do anything in the system.

Linux is a multi-user operating system. To use the system, users must first log in to the system, and after using the system, they must log out of the system.
When a user logs in to the system, in order to enable the system to identify himself, he must enter a user name and password, and can enter the system only after the system has verified that it is correct. Two kinds of accounts can be created during system installation:

1. root – super user account, which can be used to do anything in the system.

2. Ordinary user – This account is for ordinary users and can perform limited operations.

General Linux users are ordinary users, and system administrators generally use the super user account to complete some system management tasks. If you only need to complete some tasks that can be completed by a normal account, it is recommended not to use the super user account to avoid unintentional damage to the system.

User login is carried out in two steps: the first step is to enter the user's login name, and the system will identify the user according to the login name; the second step is to enter the user's password, which is a string selected by the user, and is used for other users. Confidential is the keyword used by the system to identify real and fake users when logging in.

In Linux systems, the system administrator assigns the user a username and an initial password when creating a new account for the user. In addition, the Linux system assigns a hostname to the computer. The hostname is used to identify individual computers on the network (even if the user's computer is not connected to the Internet, it should have a hostname). The default hostname given by the Linux system is: localhost. In the example below, we assume the username is "xxq" and the hostname of the system is "localhost".

1. Enter the system (login)

1. Log in as a super user;

The username of the superuser is root, and the password is set when the system is installed. After the system starts successfully, the screen displays the following prompt:

localhost login:

Enter the super user name "root" at this time, and then type the Enter key. At this point, the user will be prompted to enter a password on the screen:

localhost login:root

Password:

At this point, a password is required. When entering a password, the password will not be displayed on the screen. If the user enters the wrong password, you will see the following message on the screen:

login incorrect. You

will need to re-enter it. When the user correctly enters the user name and password, they can legally enter the system. The screen displays:

[root@loclhost ~] #At

this point, the user has logged in to the system and can operate. Here "#" is the system prompt for superuser.

2. Ordinary user login

Ordinary user login After establishing an ordinary user account, you can log in.

When logging in, the user will see a prompt similar to the following on the screen:

localhost login:

At this point enter the username "xxq" and then type the Enter key. At this point, the user will be prompted to enter a password on the screen:

localhost login:xxq

Password:

At this point, a password is required. When entering a password, the password will not be displayed on the screen. If the user enters the wrong password, you will see the following message on the screen:

login incorrect. You

will need to re-enter it. When the user correctly enters the user name and password, they can legally enter the system. screen display:

[xxq@loclhost xxq] $

This indicates that the user has logged in to the system and can operate.

Second, modify the password

In order to better protect the security of the user account, Linux allows users to modify their passwords at any time. The command to modify the password is passwd, which will prompt the user to enter the old password and the new password, and then ask the user to confirm the new password again. To avoid users accidentally pressing the wrong key. If the user forgets the password, you can ask the system administrator to reset one for himself.

Third, the virtual console

Linux is a true multi-user operating system, which means that it can accept multiple user logins at the same time. Linux also allows a user to log in multiple times, because Linux, like many versions of UNIX, provides access to a virtual console, allowing users to log in from the console at the same time (the system console is a monitor directly connected to the system device and keyboard) for multiple logins.

Virtual console selection can be done by pressing [Ctrl] + [Alt] + [F1]~[F6].

For example, after the user logs in, press the [Ctrl] + [Alt] + [F2] keys, the user can see the "login:" prompt again, indicating that the user sees the second virtual console. Then just press [Ctrl] + [Alt] + [F1] to get back to the first virtual console. A freshly installed Linux system allows users to use the [Ctrl] + [Alt] + [F1] to [Ctrl] + [Alt] + [F6] keys to access the first six virtual consoles. [Ctrl] + [Alt] + [F7] is to return to the graphical desktop;

the virtual console allows users to work on multiple consoles at the same time, and truly feel the multi-user characteristics of the Linux system. Users can switch to another virtual console to start another work when the work on one virtual console has not ended. For example, when developing software, you can edit on one console, compile on another, and consult information on a third console.

4. Exit the system

Whether it is a super user or an ordinary user, when you need to exit the system, you can type the following commands at the shell prompt.

The following is an example of the exit of a common user to illustrate the process of exiting the system:

[xxq@loclhost xxq] $ exit

There are other ways to exit the system, but the above one is the safest.

Reprint

http://blog.csdn.net/huangxiang360729/article/details/52650107
I have a few Alibaba Cloud lucky coupons to share with you, and there will be special surprises for purchasing or upgrading Alibaba Cloud products with the coupons! Take all the lucky coupons for the products you want to buy! Hurry up, it's about to be sold out.
https://promotion.aliyun.com/ntms/act/ambassador/sharetouser.html?userCode=6evata1e&utm_source=6evata1eCopyright

notice: The content of this article is contributed by Internet users voluntarily, and this community does not own the ownership and does not assume relevant legal responsibility. If you find any content suspected of plagiarism in this community, please send an email to: [email protected] to report and provide relevant evidence. Once verified, this community will immediately delete the allegedly infringing content.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326107437&siteId=291194637