1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AmazonLinux2の初期設定をコンソール画面から

Last updated at Posted at 2018-09-27

AmazonLinux2のローンチ時に実行したいコマンドを
作成時のコンソール画面上から登録、実行するやりかた。

##やること

  1. yumアップデート
  2. タイムゾーン設定(JST)
  3. 言語設定(日本語)
  4. swap作成
  5. 再起動

##スクリプト

#!/bin/bash

#パッケージ更新
yum -y update

#タイムゾーン設定
timedatectl set-timezone Asia/Tokyo

#言語設定
localectl set-locale LANG=ja_JP.utf8
localectl set-keymap jp106

#swap作成
dd if=/dev/zero of=/mnt/swapfile bs=1M count=2048
mkswap /mnt/swapfile
swapon /mnt/swapfile
chmod 0600 /mnt/swapfile
echo "/mnt/swapfile swap swap defaults 0 0" >> /etc/fstab

#再起動
reboot

##登録(赤枠に上記スクリプトをぶち込みます) → 後は順を追ってローンチまで
userData.PNG

備考

#設定できるタイムゾーンリスト
timedatectl list-timezones

#設定できる言語リスト
localectl list-locales
1
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?