How to modify the host name of Alibaba Cloud lightweight application server/cloud server

888u

Last update at :2024-03-21,Edit by888u

The server name (Hostname) of Alibaba Cloud host is a long period of random characters, so when we remotely connect to Alibaba Cloud VPS, root@ will be followed by a long period. If we have multiple Alibaba Cloud hosts, this will It is very inconvenient for us to distinguish. Today, this site will introduce two methods to modify the Alibaba Cloud lightweight application host and cloud host server names.

1. How to modify the server name of Alibaba Cloud Host ECS

Alibaba Cloud official website: https://www.aliyun.com

Alibaba Cloud provides a way to modify the server name online for cloud host ECS. Open the Alibaba Cloud official website and log in. You can modify the server name on the instance details page of the cloud host ECS:

Enter the instance name and HostName to modify:

After modification, you need to restart the instance for the new server name to take effect.

In addition to the methods provided on the official website, we can also modify the server name of the cloud host ECS in the same way as the method of modifying the lightweight application host server name in Part 2.

2. How to modify the server name of Alibaba Cloud lightweight application host

Alibaba Cloud lightweight application host currently does not have the function to modify the server name (Hostname). You can only modify the instance name in the Alibaba Cloud official website background, but it is not the server name, so we need to directly modify the server name through Linux commands.

There are two ways.

Method 1,

Modify the file /etc/hostname. This file stores the server name (Hostname). You can directly edit this file with the vim editor (root permission is required): "Using vim to edit and create new files under Linux"

Method 2,

Use the hostnamectl tool to modify:

hostnamectl set-hostname your_hostname

After modifying and restarting, and then connecting to Alibaba Cloud VPS, the new server name will be displayed (the string of characters after root@):

Recommended site search: space rental website IP address query high defense US server, com domain name registration 1 yuan, domain name query, free mainland China space, US domain name registration, web page registration, US imitation brand space, high defense US server, < /p>

How to modify the host name of Alibaba Cloud lightweight application server/cloud server

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码