提供:すだちネットWiki
移動: 案内, 検索

初期設定(SL6)

Scientific Linux 6インストール直後の初期設定を行う。

目次

Scientific Linux6初期設定

rootでのログイン&ログアウト

host3 login: root ← ログインユーザ名としてrootと入力
Password:  ← rootのパスワード応答(表示はされない)

[root@host3 ~]#  ← rootでログインした状態

[root@host3 ~]# exit ← ログアウト

centos login: ← ログアウトした状態

一般ユーザの作成&削除(例として一般ユーザ名をsudachiとする)

[root@host3 ~]# useradd sudachi ← 一般ユーザsudachiの作成

[root@host3 ~]# passwd sudachi ← sudachiのパスワード設定
Changing password for user sudachi.
New UNIX password:  ← sudachiのパスワード応答
Retype new UNIX password:  ← sudachiのパスワード応答(確認)
passwd: all authentication tokens updated successfully.

[root@host3 ~]# userdel -r sudachi ← 一般ユーザsudachiの削除

rootになれるユーザを管理者のみにする

例として、管理者用の一般ユーザ名をsudachiとする

[root@host3 ~]# usermod -G wheel sudachi ← 管理者ユーザをwheelグループに追加

[root@host3 ~]# vi /etc/pam.d/su
#auth       required     pam_wheel.so use_uid
↓
auth       required     pam_wheel.so use_uid ← コメント解除

管理者用一般ユーザからはrootになれて、管理者以外の一般ユーザからはrootになれないことを確認

root宛メールを転送する

システムからroot宛に重要なメールが送られてくるので、root宛メールを普段使用しているメールアドレス宛に転送するようにする。

[root@host3 ~]# yum -y install mailx ← mailコマンドをインストール

[root@host3 ~]# sed -i '/^root:/d' /etc/aliases ← 旧root宛メール転送設定削除

[root@host3 ~]# echo "root: xxxxx@sudachi.jp" >> /etc/aliases
 ↑ root宛メールを普段使用しているメールアドレス(例:xxxxx@sudachi.jp)宛に転送する

[root@host3 ~]# newaliases ← 転送設定反映

[root@host3 ~]# echo test|mail root ← テストメールをroot宛に送信する

テストメールが転送先メールアドレス宛に届いていることを確認する

SELinuxの無効化

[root@host3 ~]# getenforce ← SELinux状態確認
Enforcing ← SELinux有効

[root@host3 ~]# setenforce 0 ← SELinux無効化

[root@host3 ~]# getenforce ← SELinux状態確認
Permissive ← SELinux無効

[root@host3 ~]# vi /etc/sysconfig/selinux ← SELinux設定ファイル編集
SELINUX=enforcing
↓
SELINUX=disabled ← システム起動時にSELinuxを無効化

システム最新化

kernelを自動アップデート対象にする。

[root@host3 ~]# vi /etc/sysconfig/yum-autoupdate ← yum-autoupdate設定ファイル編集
EXCLUDE="kernel* openafs* *-kmdl-* kmod-* *firmware*"
↓
EXCLUDE="openafs* *-kmdl-* kmod-* *firmware*" ← kernel*をアップデート除外から削除

yumコマンドでシステムを最新化します。が、その前に、yumを使うとき、通信速度の早いミラーサーバーを探して、そこからダウンロードするyumプラグインを先に入れておきます。

[root@host3 ~]# vi /etc/yum.repos.d/sl.repo
↓ 7行目:コメント解除
mirrorlist=http://ftp.scientificlinux.org/linux/scientific/mirrorlist/sl-base-6.txt

[root@host3 ~]# vi /etc/yum.repos.d/sl-updates.repo
↓ 7行目:コメント解除
mirrorlist=http://ftp.scientificlinux.org/linux/scientific/mirrorlist/sl-security-6.txt

[root@host3 ~]# yum -y install yum-plugin-fastestmirror
Setting up Install Process
・
・
・
Complete!

[root@dlp ~]# yum -y update

cron の設定

RHEL6 (互換である Scientific Linux 6 や CentOS 6 も同様) から、デフォルトでは「cronie-anacron」というパッケージがインストールされ、ジョブの定期実行は anacron で制御されるようになっています。このため、cron のように決まりきった時間にジョブが実行されるわけではなく、設定された時間内(3時-22時)に、ランダムに設定された時間分(0分-45分)待って実行されます。これを従来通りの cron の設定に戻します。

[root@host3 ~]# yum -y install cronie-noanacron

anacron設定のパッケージを削除します。

[root@host3 ~]# yum -y remove cronie-anacron

ファイアウォール

ネットワーク内の上位にファイアウォールがおり、ホスト側では必要なければ停止しておきます。

[root@host3 ~]# /etc/rc.d/init.d/iptables stop
iptables: Flushing firewall rules:                    [ OK ]
iptables: Setting chains to policy ACCEPT: filter     [ OK ]
iptables: Unloading iptables modules:                 [ OK ]

[root@host3 ~]# chkconfig iptables off
[root@host3 ~]# chkconfig ip6tables off

nkfコマンドインストール

日本語処理に必要なnkfコマンドをインストールする

[root@host3 ~]# yum -y install nkf ← nkfインストール
案内
ツールボックス
PR
個人用ツール