サーバ構築メモ - 初期設定
Bondingの設定が完了したところで、いろいろ初期設定。
rootになれるユーザを限定する
[root@serv01 ~]# usermod -G wheel yamkazu [root@serv01 ~]# vi /etc/pam.d/su #auth required pam_wheel.so use_uid ↓コメントアウトを外す auth required pam_wheel.so use_uid
yamkazuからしかrootになれないことを確認する。
yumの自動UPDATEの設定
[root@serv01 ~]# /etc/rc.d/init.d/yum-updatesd stop yum-updates を停止中: [ OK ] [root@serv01 ~]# yum -y remove yum-updatesd [root@serv01 ~]# yum -y install yum-fastestmirror [root@serv01 ~]# yum -y update …終るまで待つ [root@serv01 ~]# yum -y install yum-cron [root@serv01 ~]# /etc/rc.d/init.d/yum-cron start [root@serv01 ~]# chkconfig yum-cron on
root宛メールを転送する
[root@serv01 ~]# vi /etc/aliases 最終行に以下を追加 root: yamkazu@example.com [root@serv01 ~]# newaliases /etc/aliases: 77 aliases, longest 20 bytes, 789 bytes total [root@serv01 ~]# echo test|mail root メールが来てるか確認する
ntpサーバの設定
[root@serv01 ~]# yum -y install ntp [root@serv01 ~]# vi /etc/ntp.conf コメントアウトして自分のネットワークに合わせて設定 restrict 192.168.65.0 mask 255.255.255.0 nomodify notrap 既存のNTPサーバを変更 #server 0.centos.pool.ntp.org #server 1.centos.pool.ntp.org #server 2.centos.pool.ntp.org server -4 ntp.nict.jp # 日本標準時を提供しているNTPサーバー(stratum 1) server -4 ntp.jst.mfeed.ad.jp # 上記サーバーと直接同期しているNTPサーバー(stratum 2) server -4 プロバイダのNTPサーバー名 # プロバイダのNTPサーバー※ [root@serv01 ~]# ntpdate ntp.nict.jp 8 Oct 01:03:28 ntpdate[16209]: step time server 133.243.238.244 offset 1523.029556 sec [root@serv01 ~]# /etc/rc.d/init.d/ntpd start ntpd を起動中: [ OK ] [root@serv01 ~]# chkconfig ntpd on [root@serv01 ~]# chkconfig --list ntpd