$ sudo vi /etc/hostname
new-hostname
$ sudo vi /etc/cloud/cloud.cfg
preserve_hostname:true
$ sudo vi /etc/sysconfig/selinux
#SELINUX=enforcing
SELINUX=disabled
$ sudo localectl set-locale LANG=ja_JP.utf8
$ sudo localectl set-keymap jp106
$ localectl status
System Locale: LANG=ja_JP.utf8
VC Keymap: jp106
X11 Layout: jp
X11 Model: jp106
X11 Options: terminate:ctrl_alt_bksp
$ sudo timedatectl set-timezone Asia/Tokyo
$ timedatectl status
Local time: 金 2016-01-01 23:32:23 JST
Universal time: 金 2016-01-01 14:32:23 UTC
Timezone: Asia/Tokyo (JST, +0900)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
$ sudo systemctl stop postfix.service
$ sudo systemctl disable postfix.service
rm '/etc/systemd/system/multi-user.target.wants/postfix.service'
$ systemctl list-unit-files --type service | grep postfix
postfix.service disabled
$ sudo yum install firewalld
$ sudo systemctl start firewalld
$ firewall-cmd --list-all
public (default)
interfaces:
sources:
services: dhcpv6-client ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
$ sudo firewall-cmd --permanent --add-port=20022/tcp
$ sudo firewall-cmd --reload
$ sudo semanage port -a -t ssh_port_t -p tcp 20022
$ sudo semanage port -l | grep ssh
ssh_port_t tcp 20022, 22
$ sudo vi /etc/ssh/sshd_config
Port 20022
$ sudo systemctl restart sshd.service
$ exit
$ ssh -i aws-centos70.pem -p 20022 new-username@XXX.XXX.XXX.XXX