如何在 CoreOS Linux 上设置/更改主机名
以下配置将为您提供一组有关如何更新 CoreOS Linux 服务器上的主机名的命令。让我们首先显示当前主机名:
localhost ~ # hostnamectl
Static hostname: n/a
Transient hostname: localhost
Icon name: computer-desktop
Chassis: desktop
Machine ID: 1759d8fe862a4c17b50a56eebb7a1e26
Boot ID: 0de6b2cfbf31454299af6729737fc648
Operating System: CoreOS 723.3.0
Kernel: Linux 4.0.5
Architecture: x86-64
再次使用 hostnamectl
命令,我们现在将新主机名设置为 coreos
:
localhost ~ # hostnamectl set-hostname coreos
确认设置正确:
localhost ~ # hostnamectl
Static hostname: coreos
Icon name: computer-desktop
Chassis: desktop
Machine ID: 1759d8fe862a4c17b50a56eebb7a1e26
Boot ID: 0de6b2cfbf31454299af6729737fc648
Operating System: CoreOS 723.3.0
Kernel: Linux 4.0.5
Architecture: x86-64
您的提示主机名将在您下次登录 CoreOS 系统时显示新的主机名。