搜索
您的当前位置:首页Set Hostname on CentOS

Set Hostname on CentOS

来源:乌哈旅游

Step 1: Use the hostname utility

Change your hostname to a different name of your choosing. For example:

hostname server01

Step 2: Edit /etc/hosts

Open the /etc/hosts file with your favorite text editor. For example:

nano /etc/hosts

Change the first line and replace your old hostname with the new one. Save the file and exit the editor.

Step 3: Edit /etc/sysconfig/network

This file also contains your hostname. Open the /etc/sysconfig/network file with your favorite text editor.

Change HOSTNAME=vultr to your desired hostname. For example: HOSTNAME=server01.

Step 4: Check your hostname

Run the following command to check your new hostname:

hostname

The new hostname will be displayed in your ssh terminal.


Read more at: https://www.vultr.com/docs/how-to-change-your-hostname-on-centos

因篇幅问题不能全部显示,请点此查看更多更全内容

Top