[更新: 2017年2月2日]
さくらのクラウドで提供中のCentOS 7.3 (1611) 64bit パブリックアーカイブの設定内容について記載します。
CentOS パブリックアーカイブのバージョンごとの変更履歴詳細につきましては、さくらのクラウドニュース アーカイブ 記事一覧から、該当バージョンのパブリックアーカイブ公開のお知らせをご覧ください。
目次
- 管理ユーザ
- SELinux
- ロケール
- 言語
- 地域
- ディスク
- ネットワーク
- インタフェース
- プロトコル
- ホスト名
- ネームサーバ
- その他
- NTP
- chronyd
- ntpd
- ntpdate
- ファイアウォール
- firewalld
- fail2ban
- SSH
- Postfix
- X Window system
- GRUB
- AutoFsck
- デーモン
- パッケージ
- ソフトウェアリポジトリ
管理ユーザ
アカウント名 | root |
---|---|
初期パスワード | なし(ディスク修正から設定可能) |
SELinux
無効
設定ファイル | /etc/sysconfig/selinux |
---|---|
設定内容 | SELINUX=disabled |
ロケール
言語 | LANG=C |
---|---|
タイムゾーン | Asia/Tokyo(JST) |
ディスク
パーティションテーブル | GPT |
---|
パーティション構成
パーティション番号 | マウントポイント | パーティション名 | フォーマット | 容量 |
---|---|---|---|---|
1 | - | BIOS boot partition | bios_grubフラグ (EF02) | 1024KB |
2 | /dev/shm | Linux swap | tmpfs (8200) | 4GB |
3 | / | Linux filesystem | ext4 (8300) | 残りのディスク容量まで拡張 |
ネットワーク
インタフェース | eth0 |
---|---|
プロトコル | IPv4:有効、IPv6:無効 ※1 |
ホスト名 | localhost.localdomain(ディスク修正から設定可能) |
ネームサーバ | 石狩リージョン: 133.242.0.3(dns13.sakura.ad.jp) 133.242.0.4(dns14.sakura.ad.jp) 東京リージョン: 210.188.224.10(dns5.sakura.ad.jp) 210.188.224.11(dns6.sakura.ad.jp) |
※1 IPv6でRAによるアドレス設定を受け付けない
設定ファイル | /etc/sysctl.conf |
---|---|
設定内容 | net.ipv6.conf.default.accept_ra=0 net.ipv6.conf.all.accept_ra=0 net.ipv6.conf.eth0.accept_ra=0 |
NTP
NTPサーバ | ntp1.sakura.ad.jp |
---|
chronyd
- 上位NTPサーバをntp1.sakura.ad.jpに設定し、時刻問い合わせをおこなう
- 自身がNTPサーバとしては動作しない(時刻の問い合わせに対し応答しない)
- chronydをユーザchronyの権限で動作させる
- chronydをRAM上で動作させページアウトをおこなわない
設定ファイル | /etc/chrony.conf |
---|---|
設定内容 | server ntp1.sakura.ad.jp iburst# Listen for commands only on localhost. bindcmdaddress 127.0.0.1 bindcmdaddress ::1# This option allows you to configure the port on which chronyd will listen for NTP requests. # The compiled in default is udp/123, the standard NTP port. If set to 0, chronyd will not open the server # socket and will operate strictly in a client-only mode. port 0# User to which will chronyd switch on initialisation to drop root privileges. user chrony# Deny access to chronyc from other computers. cmddeny all # Lock chronyd into RAM so that it will never be paged out. |
ntpd
設定ファイルの書き換えをおこないますが、アーカイブインストール直後の設定ではntpdは起動いたしません。
- 上位NTPサーバをntp1.sakura.ad.jpに設定し、時刻問い合わせをおこなう
- 自身がNTPサーバとしては動作しない(時刻の問い合わせに対し応答しない)
- monlist機能を無効化
設定ファイル | /etc/ntp.conf |
---|---|
設定内容 | restrict -4 default ignore restrict -6 default ignorerestrict ntp1.sakura.ad.jp kod nomodify notrap nopeer noquery disable monitor |
ntpdate
設定ファイルの書き換えをおこないますが、アーカイブインストール直後の設定ではntpdateは起動いたしません。
- リトライをおこなわない
- NTPでの時刻同期の際にサーバ内のハードウェアクロックを更新
設定ファイル | /etc/sysconfig/ntpdate |
---|---|
設定内容 | # Options for ntpdate OPTIONS=”-U ntp -s -b”# Set to ‘yes’ to sync hw clock after successful ntpdate SYNC_HWCLOCK=yes |
ファイアウォール
firewalld
- 有効
- 初期設定ではeth0のゾーンはpublic、サービスはデフォルト設定(dhcpv6-client, sshのみ許可)
fail2ban
- 有効(10分間にSSHのログイン試行5回失敗で10分間接続拒否)
- /var/log/fail2ban.logにログを出力する
設定ファイル | /etc/fail2ban/fail2ban.conf |
---|---|
設定内容 | logtarget = /var/log/fail2ban.log |
設定ファイル | /etc/fail2ban/jail.d/local.conf |
---|---|
設定内容 | [DEFAULT] banaction = firewallcmd-ipset backend = systemd [sshd] enabled = true |
SSH
- 以下のユーザ名でのSSH接続を拒否する
toor administrator administrateur admin adm test guest info mysql user oracle
- GSSAPI認証を無効にする
- GSSAPI認証情報のキャッシュをユーザログアウト時に自動的に削除しない
- PAMを無効にする
設定ファイル | /etc/ssh/sshd_config |
---|---|
設定内容 | DenyUsers toor administrator administrateur admin adm test guest info mysql user oracle GSSAPIAuthentication yes 削除 GSSAPICleanupCredentials yes 削除 UsePAM yes 削除 |
Postfix
ローカルマシンのみ許可
設定ファイル | /etc/postfix/main.cf |
---|---|
設定内容 | mynetworks_style = host |
X Window system
下記の設定ファイルを使用
設定ファイル | /etc/X11/xorg.conf |
---|---|
設定内容 | # Xorg configuration created by pyxf86config
Section “ServerLayout” Section “InputDevice” Section “InputDevice” Section “Device” Section “Screen” |
GRUB
- OS起動に関する変更
- 起動時にRed Hat Graphical Bootではなくテキストモードを使用する
- 起動時にカーネルメッセージを表示する
- 起動時に時刻のずれを修正する
- コンソール表示に関する変更
- コンソールで使用するフォントをlatarcyrheb-sun16に変更する
- コンソールがblank状態になるのを抑止する
- Xサーバが起動するまではビデオドライバをロードせずBIOSモードを使用する
- その他の変更
- カーネルダンプを取得しない
- NOOPスケジューラを使用する
- systemd/udevによるNIC命名をおこなわない
- biosdevnameによるNIC命名をおこなわない
設定ファイル | /etc/default/grub |
---|---|
設定内容 | GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR=”$(sed ‘s, release .*$,,g’ /etc/system-release)” GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT=”console” GRUB_CMDLINE_LINUX=”vconsole.font=latarcyrheb-sun16 consoleblank=0 clock=pit nomodeset elevator=noop net.ifnames=0 biosdevname=0″ GRUB_DISABLE_RECOVERY=”true” |
AutoFsck
起動時にfsckをおこなう
設定ファイル | /etc/sysconfig/autofsck |
---|---|
設定内容 | AUTOFSCK_DEF_CHECK=yes |
デーモン
自動起動設定(稼働中)のサービス一覧
サービス名 | 機能説明 | 外部からの接続ポート |
---|---|---|
chronyd | システムクロックを調整するためのサービス | – |
crond | 定期的にジョブを実行するためのcronサービス | – |
dbus | アプリケーションがプロセス間通信をおこなうためのメッセージバスデーモン | – |
fail2ban | 不正の兆候がある接続を拒否する機能 | – |
firewalld | ゾーンに対応し、動的に設定をおこなうファイアウォール | – |
agetty | 起動時に仮想端末に自動ログインする | – |
irqbalance | マルチプロセッサな環境での IRQ の割り込み処理用のサービス | – |
NetworkManager | ネットワークデバイスと接続を動的に管理するデーモン | – |
postfix | MTA 機能 | 25/smtp |
polkit | 権限を定義し処理するためのツールキット | – |
rsyslog | システムのログを記録 | – |
sshd | SSH(Secure Shell)サーバサービス | 22/tcp |
systemd-journald | ログデータを収集、管理するサービス | – |
systemd-logind | ユーザログインを管理するサービス | – |
systemd-udevd | カーネルのueventを管理するデーモン | – |
tuned | システムコンポーネントの使用を監視し動的にシステム設定をチューニングするデーモン | – |
network | ネットワーク・インターフェイスの初期化スクリプト /etc/init.d/network {start|stop|restart|reload|status} |
– |
デフォルト設定より自動起動を無効化したサービス一覧
サービス名 | 機能説明 | 外部からの接続ポート |
---|---|---|
auditd | 監査レコードを記録するデーモン | – |
lvm2-lvmetad | LVMコマンドのパフォーマンス向上、ボリュームの自動有効化をおこなうデーモン | – |
wpa_supplicant | IEEE 802.1X/WPAサプリカント | – |
パッケージ
インストール済のパッケージグループ
@ Development Tools @ Japanese Support @ X Window System @ fonts
インストール済のパッケージ
chrony epel-release fail2ban libcurl nss tcpdump traceroute yum-plugin-fastestmirror
除外したパッケージ
microcode_ctl ntp rdma
ソフトウェアリポジトリ
リポジトリ設定ファイル | /etc/yum.repos.d 以下 |
---|
repo id | repo name | status | リポジトリ設定ファイル |
---|---|---|---|
base/7/x86_64 | CentOS-7 - Base | enabled | CentOS-Base.repo |
extras/7/x86_64 | CentOS-7 - Extras | enabled | CentOS-Base.repo |
updates/7/x86_64 | CentOS-7 - Updates | enabled | CentOS-Base.repo |
centosplus/7/x86_64 | CentOS-7 - Plus | disabled | CentOS-Base.repo |
cr/7/x86_64 | CentOS-7 - cr | disabled | CentOS-CR.repo |
base-debuginfo/x86_64 | CentOS-7 - Debuginfo | disabled | CentOS-Debuginfo.repo |
fasttrack/7/x86_64 | CentOS-7 - fasttrack | disabled | CentOS-fasttrack.repo |
c7-media | CentOS-7 - Media | disabled | CentOS-Media.repo |
base-source/7 | CentOS-7 - Base Sources | disabled | CentOS-Sources.repo |
centosplus-source/7 | CentOS-7 - Plus Sources | disabled | CentOS-Sources.repo |
extras-source/7 | CentOS-7 - Extras Sources | disabled | CentOS-Sources.repo |
updates-source/7 | CentOS-7 - Updates Sources | disabled | CentOS-Sources.repo |
C7.0.1406-base/x86_64 | CentOS-7.0.1406 - Base | disabled | CentOS-Vault.repo |
C7.0.1406-centosplus/x86_64 | CentOS-7.0.1406 - CentOSPlus | disabled | CentOS-Vault.repo |
C7.0.1406-extras/x86_64 | CentOS-7.0.1406 - Extras | disabled | CentOS-Vault.repo |
C7.0.1406-fasttrack/x86_64 | CentOS-7.0.1406 - CentOSPlus | disabled | CentOS-Vault.repo |
C7.0.1406-updates/x86_64 | CentOS-7.0.1406 - Updates | disabled | CentOS-Vault.repo |
C7.1.1503-base/x86_64 | CentOS-7.1.1503 - Base | disabled | CentOS-Vault.repo |
C7.1.1503-centosplus/x86_64 | CentOS-7.1.1503 - CentOSPlus | disabled | CentOS-Vault.repo |
C7.1.1503-extras/x86_64 | CentOS-7.1.1503 - Extras | disabled | CentOS-Vault.repo |
C7.1.1503-fasttrack/x86_64 | CentOS-7.1.1503 - CentOSPlus | disabled | CentOS-Vault.repo |
C7.1.1503-updates/x86_64 | CentOS-7.1.1503 - Updates | disabled | CentOS-Vault.repo |
C7.2.1511-base/x86_64 | CentOS-7.2.15011 - Base | disabled | CentOS-Vault.repo |
C7.2.1511-centosplus/x86_64 | CentOS-7.2.1511 - CentOSPlus | disabled | CentOS-Vault.repo |
C7.2.1511-extras/x86_64 | CentOS-7.2.1511 - Extras | disabled | CentOS-Vault.repo |
C7.2.1511-fasttrack/x86_64 | CentOS-7.1.1503 - CentOSPlus | disabled | CentOS-Vault.repo |
C7.2.1511-updates/x86_64 | CentOS-7.1.1503 - Updates | disabled | CentOS-Vault.repo |
elrepo | ELRepo.org Community Enterprise Linux Repository - el7 | disabled | elrepo.repo |
elrepo-extras | ELRepo.org Community Enterprise Linux Extras Repository - el7 | disabled | elrepo.repo |
elrepo-kernel | ELRepo.org Community Enterprise Linux Kernel Repository - el7 | disabled | elrepo.repo |
elrepo-testing | ELRepo.org Community Enterprise Linux Testing Repository - el7 | disabled | elrepo.repo |
epel/x86_64 | Extra Packages for Enterprise Linux 7 - x86_64 | disabled | epel.repo |
epel-debuginfo/x86_64 | Extra Packages for Enterprise Linux 7 - x86_64 - Debug | disabled | epel.repo |
epel-source/x86_64 | Extra Packages for Enterprise Linux 7 - x86_64 - Source | disabled | epel.repo |
epel-testing/x86_64 | Extra Packages for Enterprise Linux 7 - Testing - x86_64 | disabled | epel-testing.repo |
epel-testing-debuginfo/x86_64 | Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Debug | disabled | epel-testing.repo |
epel-testing-source/x86_64 | Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Source | disabled | epel-testing.repo |
mysql-connectors-community/x86_64 | MySQL Connectors Community | disabled | mysql-community.repo |
mysql-tools-community/x86_64 | MySQL Tools Community | disabled | mysql-community.repo |
mysql55-community/x86_64 | MySQL 5.5 Community Server | disabled | mysql-community.repo |
mysql56-community/x86_64 | MySQL 5.6 Community Server | disabled | mysql-community.repo |
mysql57-community-dmr/x86_64 | MySQL 5.7 Community Server Development Milestone Release | disabled | mysql-community.repo |
mysql-connectors-community-source | MySQL Connectors Community - Source | disabled | mysql-community-source.repo: |
mysql-tools-community-source | MySQL Tools Community - Source | disabled | mysql-community-source.repo: |
mysql55-community-source | MySQL 5.5 Community Server - Source | disabled | mysql-community-source.repo: |
mysql56-community-source | MySQL 5.6 Community Server - Source | disabled | mysql-community-source.repo: |
mysql57-community-dmr-source | MySQL 5.7 Community Server Development Milestone Release - Source | disabled | mysql-community-source.repo: |
remi | Remi’s RPM repository for Enterprise Linux 7 - x86_64 | disabled | remi.repo |
remi-debuginfo/x86_64 | Remi’s RPM repository for Enterprise Linux 7 - x86_64 - debuginfo | disabled | remi.repo |
remi-php55 | Remi’s PHP 5.5 RPM repository for Enterprise Linux 7 - x86_64 | disabled | remi.repo |
remi-php55-debuginfo/x86_64 | Remi’s PHP 5.5 RPM repository for Enterprise Linux 7 - x86_64 - debuginfo | disabled | remi.repo |
remi-php56 | Remi’s PHP 5.6 RPM repository for Enterprise Linux 7 - x86_64 | disabled | remi.repo |
remi-php56-debuginfo/x86_64 | Remi’s PHP 5.6 RPM repository for Enterprise Linux 7 - x86_64 - debuginfo | disabled | remi.repo |
remi-test | Remi’s test RPM repository for Enterprise Linux 7 - x86_64 | disabled | remi.repo |
remi-test-debuginfo/x86_64 | Remi’s test RPM repository for Enterprise Linux 7 - x86_64 - debuginfo | disabled | remi.repo |
remi-php70 | Remi’s PHP 7.0 RPM repository for Enterprise Linux 7 - x86_64 | disabled | remi-php70.repo |
remi-php70-debuginfo/x86_64 | Remi’s PHP 7.0 RPM repository for Enterprise Linux 7 - x86_64 - debuginfo | disabled | remi-php70.repo |
remi-php70-test | Remi’s PHP 7.0 test RPM repository for Enterprise Linux 7 - x86_64 | disabled | remi-php70.repo |
remi-php70-test-debuginfo/x86_64 | Remi’s PHP 7.0 test RPM repository for Enterprise Linux 7 - x86_64 - debuginfo | disabled | remi-php70.repo |
remi-safe | Safe Remi’s RPM repository for Enterprise Linux 7 - x86_64 | disabled | remi-safe.repo |
rpmforge | RHEL 7 - RPMforge.net - dag | disabled | rpmforge.repo |
rpmforge-extras | RHEL 7 - RPMforge.net - extras | disabled | rpmforge.repo |
rpmforge-testing | RHEL 7 - RPMforge.net - testing | disabled | rpmforge.repo |
CentOS-Base.repo内のbaseurlを下記の通り変更
repo id | baseurl |
---|---|
base | http://ftp.sakura.ad.jp/pub/linux/centos/$releasever/os/$basearch/ |
updates | http://ftp.sakura.ad.jp/pub/linux/centos/$releasever/updates/$basearch/ |
extras | http://ftp.sakura.ad.jp/pub/linux/centos/$releasever/extras/$basearch/ |
centosplus | http://ftp.sakura.ad.jp/pub/linux/centos/$releasever/centosplus/$basearch/ |