1. View the current host name [root@fangjian ~]# hostnamectl Static hostname: brace Pretty hostname: Brace Icon name: computer-vm Chassis: vm Machine ID: 20191225111607875619293640639763 Boot ID: 25ac5021d229471382a26bea3d351de3 Virtualization: kvm Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-1062.9.1.el7.x86_64 Architecture: x86-64 2. Temporarily modify the host name [root@fangjian ~]# hostname yin # Temporarily modify the host name, which will become invalid after shutdown [root@fangjian ~]# hostname yin 3. Permanently change the host name 1. Method 1: Use the hostnamectl command [root@fangjian ~]# hostnamectl set-hostname Brace #Permanently set the user name, which will not expire after shutdown [root@fangjian ~]# hostname brace 2. Method 2: Modify the configuration file /etc/hostname and save and exit [root@fangjian ~]# vi /etc/hostname # Enter vi, delete the old host name, enter the new host name, Esc followed by a colon wq to exit and save the file. # reboot to take effect. The above is a simple method to change the host name in Linux. If you have any additions, please contact the editor. Thank you for your support of 123WORDPRESS.COM. You may also be interested in:
|
<<: Why is it not recommended to use index as key in react?
>>: How to optimize MySQL deduplication operation to the extreme
In the database, both UNION and UNION ALL keyword...
This article uses examples to illustrate the usag...
When I was in the securities company, because the ...
<br />I'm basically going crazy with thi...
In the previous article, we learned about the pas...
Table of contents Preface interface type Appendix...
Today I saw a little trick for HTML text escaping ...
Preface View is a very useful database object in ...
1. Introduction Earlier we talked about the front...
Ubuntu's own source is from China, so the dow...
Let's start with a description of the problem...
In Google Chrome, after successful login, Google ...
The select element creates a single-select or mult...
Install memcached yum install -y memcached #Start...
This article records the installation and configu...