function Geek()

技術的な備忘録が多くなってる。

CentOSインストール後の初期設定てきな

OSインストール後に行う初期設定的なのを書いていきます。

※僕がやっているだけなので其々の環境に合ったパターンで作業してください

 

では、本日もよろしくお願いしますー!

 

 

iptables&SELinuxの無効化

後々に厄介になってしまうSELinuxを無効化します。

 

#    getenforce

      Enforcing

 

#    setenforce 0

      Permissive

 

vi /etc/selinx/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
#  permissiveからdisabledに変更する。
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

これでrebootをすれば、完全無効化になりますがその前にiptablesも無効化しておきます。

 

iptablesの無効化

#    /etc/rc.d/init.d/iptables stop
iptables: チェインをポリシー ACCEPT へ設定中filter         [  OK  ]
iptables: ファイアウォールルールを消去中:                  [  OK  ]
iptables: モジュールを取り外し中:                          [  OK  ]


#    chkconfig --list iptables
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off


#    chkconfig iptables off

chkconfig --list iptables
iptables        0:off   1:off   2:off   3:off   4:off   5:off   6:off


これで面倒なSElinuxiptablesは完全に沈黙させてやりました!

 

 

yum update でパッケージのアップデート

yum installを行う前にインストールされている全てのパッケージのアップデートを行います。

 

#    yum update

 

こちょこちょブログで暇を潰しつつ…

はい。終了でございます。

 

 

ntpのインストール

ntpをインストールして、自動同期させます。

 

#    yum -y install ntpd

#   /etc/rc.d/init.d/ntpd start

#    ntpdate ntp.nict.jp

 

これでとりあえずは同期されます。

cronでも設定しておくと更にいいかもですね!

 

 

お疲れ様でした!