This article outlines the steps to modify the hostname on a Linux cloud server. Assuming the new hostname is 'zhaomu.com', please replace this with the actual hostname you intend to use. This guide is applicable to four Linux operating systems: CentOS, Fedora, Ubuntu, and Debian.
1.Remotely log into the system.
2.Use the 'hostnamectl' command.
hostnamectl set-hostname zhaomu.com
3.Restart the cloud server.
4.Verify the change has taken effect with the 'hostname' command.
hostname
23-02-2024 02:02:07
22-02-2024 03:19:32
22-02-2024 03:16:03
22-02-2024 03:14:03
22-02-2024 03:11:58