/
centos_basic_config
35 lines (30 loc) · 1.31 KB
/
centos_basic_config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# === パスワードによる認証を禁止
# Disable tunnelled clear text passwords
echo "set number" >> ~/.exrc
sed -i.org -e "s/#PasswordAuthentication yes/PasswordAuthentication no/g" /etc/ssh/sshd_config
sed -i.org -e "s/PasswordAuthentication yes/#PasswordAuthentication yes/g" /etc/ssh/sshd_config
service sshd restart
# === 日本語ロケールへ変更
# Change to Japanese locale
yum -y groupinstall "Japanese Support"
sed -i.org -e "s/en_US.UTF-8/ja_JP.UTF-8/g" /etc/sysconfig/i18n
# === タイムゾーンを日本標準時へ変更
# Change to JST time zone
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
#=== OSファイアウォールの設定
# Configure Linux Firewall
# --- CAUTION --- Change to deny access from public address
# iptables -A INPUT -s 10.0.0.0/8 -j ACCEPT
# iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# iptables -A INPUT -p icmp -j ACCEPT
# iptables -A INPUT -i lo -j ACCEPT
#iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
#iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
# iptables -A INPUT -s 0.0.0.0/0 -d 0.0.0.0/0 -p all -j REJECT
#service iptables save
#=== 基本ツールのインストール
# Install basic tools
# yum install -y emacs.x86_64 git-all.noarch
yum update -y