2011-06-27

CentOS 5.6 tuning.

# yum update
# yum list installed
# yum remove GConf2.x86_64
# yum remove kernel-2.6.18-238.el5
# yum remove NetworkManager NetworkManager NetworkManager-glib NetworkManager-glib
# yum remove ...



# yum install ntp.x86_64
# vi /etc/ntp.conf
(edit)> server <X.X.X.X>
# vi /etc/sysconfig/ntpd
(edit)> SYNC_HWCLOCK=yes
# chkconfig --level 3 ntpd on
# service ntpd start

# adduser -c "<User Name>" -m -u 1001 -g users -G wheel <login>
# passwd <login>

# cd /home/<User Name>
# vi .bash_profile
(edit)> PATH=$PATH:/sbin:/usr/sbin:$HOME/bin

# vi /etc/aliases
(add)> root: <login>
(add)> <login>: <user@domain>
# newaliases

# vi /etc/sysconfig/iptables
(add)> -A RH-Firewall-1-INPUT -m state --state NEW -s <X.X.X.X>/<X> -m tcp -p tcp --dport 22 -j ACCEPT
# service iptables restart
# service ntpd restart

# vi /etc/sysconfig/network
(add)> FORWARD_IPV4=no
(del)> GATEWAY=<X.X.X.X>
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
(add)> GATEWAY=<X.X.X.X>
# service network restart

# vi /etc/pam.d/su
(uncoment)> auth            required        pam_wheel.so use_uid

# vi /etc/sudoers
(uncoment)> %wheel        ALL=(ALL)       ALL

# vi /etc/ssh/sshd_config
(edit)> PermitRootLogin no
(edit)> AllowTcpForwarding no
(edit)> X11Forwarding no
# kill -HUP `cat /var/run/sshd.pid`

...