Ubuntu 22.04 LTSにホスト名を設定する方法
環境
$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=22.04 DISTRIB_CODENAME=jammy DISTRIB_DESCRIPTION="Ubuntu 22.04 LTS"
操作方法
1.現在のホスト名を表示
# hostname arte-virtual-machine
2.恒久的にホスト名を変更します
書式
hostnamectl set-hostname ホスト名
# hostnamectl set-hostname arkgame
3.設定を確認します
# hostnamectl
Static hostname: arkgame
Icon name: computer-vm
Chassis: vm
Machine ID: 444cc442f43d4ba78b07f36d4ba33b23
Boot ID: 532eadb123954a58bd8ccf1ea707109d
Virtualization: vmware
Operating System: Ubuntu 22.04 LTS
Kernel: Linux 5.15.0-40-generic
Architecture: x86-64
Hardware Vendor: VMware, Inc.
Hardware Model: VMware Virtual Platform