Cloud Server ECS Linux host modifies host name
There are two ways to modify cloud server ECS Linux hostname, which is outlined in this article.
Temporary effective modification
Using the command line to modify the hostname hostname (customizable), the login shell takes effect.
You can see that the shell is in effect when you log back in
Permanent change in effect
Take the CentOS system as an example, you need to change the configuration file to take effect, modify the hostname= hostname (customizable) in the/etc/sysconfig/network, and reboot takes effect.
If it is an Ubuntu system, you will need to modify the file/etc/hostname to modify its hostname to the new hostname.
Finally, you need to replace the old hostname in/etc/hosts with the new host name 127.0.0.1. As shown
Note: If it is a CentOS 7 operating system, you can use the command hostnamectl set-hostname 主机名
to modify, and then re-SHELL login after the change.
Cloud Server ECS Linux Ubuntu host modifies host name