Cloud Server ECS Linux Ubuntu host modifies host name

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.