RHEL hostname change
명령어를 통해 Hostname 변경하기
hostnamectl 명령의 옵션은 다음과 같습니다.
[root@rhel861 ~]# hostnamectl -h
hostnamectl [OPTIONS...] COMMAND ...
Query or change system hostname.
-h --help Show this help
--version Show package version
--no-ask-password Do not prompt for password
-H --host=[USER@]HOST Operate on remote host
-M --machine=CONTAINER Operate on local container
--transient Only set transient hostname
--static Only set static hostname
--pretty Only set pretty hostname
Commands:
status Show current hostname settings
set-hostname NAME Set system hostname
set-icon-name NAME Set icon name for host
set-chassis NAME Set chassis type for host
set-deployment NAME Set deployment environment for host
set-location NAME Set location for host
[root@rhel861 ~]#
[root@rhel861 ~]# hostnamectl set-hostname rhel862
[root@rhel861 ~]# hostname
rhel862
[root@rhel861 ~]#
변경 내역 확인
[root@rhel861 ~]# hostname
rhel862
[root@rhel861 ~]# hostnamectl status
Static hostname: rhel862
Icon name: computer-vm
Chassis: vm
Machine ID: 9a972d7e724a41aaa1d48e5e591ff7e3
Boot ID: 01e306a9a0d044e88f4cf33c7950dc29
Virtualization: vmware
Operating System: Red Hat Enterprise Linux 8.6 (Ootpa)
CPE OS Name: cpe:/o:redhat:enterprise_linux:8::baseos
Kernel: Linux 4.18.0-372.9.1.el8.x86_64
Architecture: x86-64
[root@rhel861 ~]#