LoginSignup
1
4

More than 5 years have passed since last update.

RHEL7でホスト名を変更

Last updated at Posted at 2018-05-10

RHEL7でホスト名を変更する。

下記のコマンドで変更。
# hostnamectl set-hostname ホスト名(yasudasv等) --static

下記のコマンドでホスト名を確認。
# hostnamectl status

ちなみに、EC2の場合は、cloud-initの設定を変更しないと、再起動したときに変更されてしまう。

/etc/cloud/cloud.cfgに、下記の行を追加する。
# vi /etc/cloud/cloud.cfg

preserve_hostname: true

参考のURLは下記。
https://cloudpack.media/6914

1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4