What does it mean when "prompt [root@www myapp]" is displayed at the top of the command line when logging in to the Centos system with SSH?

What does it mean when "prompt [root@www myapp]" is displayed at the top of the command line when logging in to the Centos system with SSH?

When logging in to the CentOS system through SSH, the www in the prompt [root@www myapp] indicates the hostname of the current login (hostname), that is, the hostname of the currently running CentOS system.

In the prompt [root@www myapp]:
[root] indicates that the current login user is the root user
[www] indicates the current login hostname (hostname), that is, the hostname of the currently running CentOS system.
[myapp] indicates that the last level of the current path is the folder myapp

In a Linux system, each host has a unique hostname to identify itself. You can view the hostname of the current host through the command hostname, or modify the hostname by editing the /etc/hostname file.
insert image description here
What the hell is a hostname?
In the CentOS system, the hostname (hostname) is used to identify the uniqueness of a computer in the network, and has the following purposes:

Identify the computer: The hostname can help you quickly identify the computer that is currently running.

Configuring a network: When configuring a network, a hostname can be used to identify a computer's IP address. When configuring the local network, you can also map the host name and IP address by modifying the /etc/hosts file, so that you can access other computers locally.

Management system: In the CentOS system, the host name can help you quickly identify the current computer. In addition, in some services, it may also be necessary to identify and manage different nodes by hostname.

For the hostname displayed in the command prompt (such as "www" mentioned above), it is generally obtained automatically from the hostname of the computer. In CentOS, you can use the hostname command to view and set the computer's hostname.

Guess you like

Origin blog.csdn.net/wenhao_ir/article/details/130058144