0
0

hostnamectlを使ってEC2のホスト名を変更する

Last updated at Posted at 2024-02-16

概要

hostnamectlコマンドを使ってAmazonLinux2のEC2インスタンスのホスト名を変更してみる。

方法

インスタンスにSSH接続を行い、下記を実行する。

sudo hostnamectl set-hostname 新たに設定するホスト名

一度インスタンスから出て再度ssh接続を行う。
下記を実行し、設定内容を確認する。

hostnamectl status

Static hostnameなどが設定したものになっていれば作業完了となる。

参考文献

0
0
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
0
0