Linux PostInstall


Post-install items I usually do after loading Linux:
You can also download and run this postinstall.sh script.

# Run this script run after installing fedora/rhel/cent 
# Make any changes needed for your setup before running this script

# Replace username with your user name
export USER=username

# add sudo entry
echo "$USER ALL=(ALL) ALL" >> /etc/sudoers

# for ghostscript
echo letter > /etc/papersize

# disable sendmail
/sbin/chkconfig sendmail off

# configure ntp
/sbin/chkconfig ntpd on
mv /etc/ntpd.conf{,.orig}
echo "server 134.197.6.1" > /etc/ntp.conf

# configure DNS
/bin/cat > /etc/resolv.conf <<EOF
nameserver 134.197.5.1
nameserver 134.197.6.1
search cse.unr.edu me.unr.edu ecc.unr.edu engr.unr.edu it.unr.edu unr.edu
EOF

# Setup tcpwrappers
echo "ALL: ALL" >>/etc/hosts.deny
echo "sshd: 134.197.40. 134.197.34." >>/etc/hosts.allow # for CSE

# Other entries for /etc/hosts.allow:
#sshd: 134.197.75.1 134.197.1.36 # terminal servers
#sshd: 134.197.115. # wifi.unr.edu
#sshd: .dsl.renocs.nvbell.net .dsl.renocs.sbcglobal.net .dsl.renocs.pacbell.net

cat >> /etc/ssh/sshd_config <<EOF

# Disable protocol 1, it's insecure
Protocol 2

# Stop sessions from timing out
KeepAlive yes
ClientAliveInterval 60
EOF

# enable automatic daily updates
cat > /etc/cron.daily/yum.cron <<EOF
#!/bin/sh
/usr/bin/yum -R 120 -e 0 -d 0 -y update yum
/usr/bin/yum -R 10 -e 0 -d 0 -y shell /etc/yum/yum-daily.yum
EOF

cat > /etc/yum/yum-daily.yum <<EOF
update
ts run
exit
EOF

chmod 755 /etc/cron.daily/yum.cron
chmod 644 /etc/yum/yum-daily.yum

# remove the user update GUI - I prefer the daily cron job
rpm -e yum-updatesd 

# configure yum to use the fastest mirrors for updates
yum install yum-fastestmirror

/usr/bin/reboot

Updated: Mon Aug 13 11:46:04 PDT 2007