[AWS EC2] Settings you want to do on Amazon Linux 2

Overview

When you start EC2, the settings you want to do first

environment

1. Set the server time to JST

--Default is UTC --Change the timezone to Asia / Tokyo and set it to JST --Restart crond after changing the timezone

$ timedatectl status
      Local time: Fri 2020-06-26 06:10:18 UTC
  Universal time: Fri 2020-06-26 06:10:18 UTC
        RTC time: Fri 2020-06-26 06:10:18
       Time zone: n/a (UTC, +0000)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a
$ sudo timedatectl set-timezone Asia/Tokyo
$ timedatectl status
      Local time: Fri 2020-06-26 15:50:10 JST
  Universal time: Fri 2020-06-26 06:50:10 UTC
        RTC time: Fri 2020-06-26 06:50:09
       Time zone: Asia/Tokyo (JST, +0900)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a
$ sudo systemctl restart crond
$ date
Fri Jun 26 16:03:47 JST 2020

2. Change prompt

--The default is less information, so change it --Before change: [ec2-user @ ip-XX-XX-XX-XX ~] $ --After change: [16:17:47 ec2-user @ ip-XX-XX-XX-XX ~] $ --Add ʻexport PS1 to .bashrc --Edit$ PS1 in / etc / bashrc` if you want to reflect it in the whole --Don't forget to reflect with the source command

$ vi .bashrc

# User specific aliases and functions
export PS1='\[\033[37m\][\t \[\033[36m\]\u\[\033[37m\]@\h \[\033[32m\]\W\[\033[37m\]]$ '

$ source .bashrc

3. Change locale

――You don't have to do it, but if you want to have a Japanese environment, do it.

$ localectl status
   System Locale: LANG=en_US.UTF-8
       VC Keymap: n/a
      X11 Layout: n/a
$ sudo localectl set-locale LANG=ja_JP.UTF-8
$ sudo localectl set-keymap jp106
$ localectl status
   System Locale: LANG=ja_JP.UTF-8
       VC Keymap: jp106
      X11 Layout: jp
       X11 Model: jp106
     X11 Options: terminate:ctrl_alt_bksp

4. Install frequently used items

There is nothing else in it, so install the one you want to use. git

$ sudo yum install -y git
$ git -version
git version 2.23.3

reference

-Change the host name of the Amazon Linux instance

Recommended Posts

[AWS EC2] Settings you want to do on Amazon Linux 2
[AWS EC2] How to install Maven on Amazon Linux 2
AWS EC2 2nd SSH connection to EC2 Instance (Amazon Linux2)
[AWS] How to expand disk space on Amazon linux
[AWS] What to do when you want to pip with Lambda
Install pyenv on EC2 (Amazon Linux)
When you want to use python2.x on modern Gentoo Linux
What to do if you can't use WiFi on Linux
Launch NEM Symbol testnet node on AWS EC2 (Amazon Linux2)
[AWS EC2] How to install only MySQL client on Amazon Linux 2 and connect to RDS
What to do if the inode is exhausted on EC2 Linux
I'll install Ruby on EC2 (Amazon Linux2) 2020
I want to use Linux on mac
How to update php on Amazon linux 2
Upgraded mysql on Cloud9 (Amazon Linux) (5.5 to 5,7)
How to install Anisble on Amazon Linux 2
Let's summarize what you want to do.
Install Python 3.8, Pip 3.8 on EC2 (Amazon Linux 2)
What to do if you get stuck during Anaconda installation on Linux
[2020 version] How to install Python3 on AWS EC2
Creating an AWS EC2 EC2 Instance (Amazon Linux AMI) 2
I want to do pyenv + pipenv on Windows
I want to log file I / O on Linux
Jupyter Notebook Settings-How to use (EC2 Amazon Linux 2)
Do you want me to fix that copy?
[Linux] You do not have root privileges. But I want to yum install.
Deployment procedure on AWS (2) Server (EC2 instance) environment settings
Settings when you want to run python-mecab with travis
Links to do what you want with Sublime Text
Copy files directly from Amazon EC2 (Amazon linux) to S3
I want to AWS Lambda with Python on Mac!
I want to use OpenJDK 11 on Ubuntu Linux 18.04 LTS / 18.10
How to install git on Linux such as EC2
How to build a Python environment on amazon linux 2
I want to do Wake On LAN fully automatically
What to do if you get the error ʻERR_FEATURE_UNAVAILABLE_ON_PLATFORM` when using ts-node-dev on Linux
What to do when you get an error saying "Name resolution temporarily failed" on linux
read the tag assigned to you on ec2 with boto3
Put jenv on Amazon Linux
Install tomcat 5.5 on Amazon Linux.
Building an environment to execute python programs on AWS EC2
Use sshpass on Amazon linux2
Install Homebrew on Amazon Linux 2
Install strongSwan 5.9.1 on Amazon Linux 2
What to do if you lose your EC2 key pair
When you want to hit a UNIX command on Python
Sample script to monitor Load Average on CloudWatch on AWS EC2
EC2 / Amazon Linux2: What to do if you get an "unable to execute'gcc': No such file or directory" error with pip install
List of things you might need to do to develop OBD Linux on Raspberry Pi with Buildroot
Do you want to wait for general purpose in Python Selenium?
I tried to create an environment of MkDocs on Amazon Linux
I want to use shortcut translation like DeepL app on Linux
Create an AWS Cloud9 development environment on your Amazon EC2 instance
Things to note when running Python on EC2 from AWS Lambda
Add users with SSH access to your Amazon EC2 Linux instance
I want to know if you install Python on Mac ・ Iroha
Summary of installing PHP7.2 on EC2 (Amazon Linux 2) and setting php.ini
Install Python Pillow on Amazon Linux
Easy copy to clipboard on Linux
Try installing OpenAM on Amazon Linux
Preparing to run Flask on EC2