How to secure a CentOS system
Comment out unwanted users and user groups
vi /etc/passwd
vi /etc/group
chattr +i /etc/passwd
chattr +i /etc/shadow
chattr +i /etc/group
chattr +i /etc/gshadow
lsattr /etc/passwd /etc/shadow /etc/group /etc/gshadow
auth sufficient /lib/security/pam_rootok.sodebug
auth required /lib/security/pam_wheel.sogroup=isd
echo 1>/proc/sys/net/ipv4/icmp_echo_ignore_all
sysctl -a | grep syn
sysctl -w net.ipv4.tcp_max_syn_backlog=2048
sysctl -w net.ipv4.tcp_syncookies=1
sysctl -w net.ipv4.tcp_synack_retries=3
sysctl -w net.ipv4.tcp_syn_retries=3
order hosts,bind
multi on
nospoof on
* hard core 0
* hard rss 5000
* hard nproc 20
chmod 700 /usr/bin/
chmod 750 /usr/bin/*++*
chmod 750 /usr/bin/c++*
chmod 750 /usr/bin/ld
chmod 750 /usr/bin/as
locate sqlaccess
/opt/lampp/bin/mysqlaccess
chmod 755 /opt/lampp/bin/mysqlaccess
chattr +a .bash_history
chattr +i .bash_history
chmod 700 /bin/ping
chmod 700 /usr/bin/finger
chmod 700 /usr/bin/who
chmod 700 /usr/bin/w
chmod 700 /usr/bin/locate
chmod 700 /usr/bin/whereis
chmod 700 /usr/bin/vim
chmod 700 /usr/bin/make
chmod 700 /bin/netstat
chmod 700 /usr/bin/tail
chmod 700 /usr/bin/less
chmod 700 /usr/bin/head
chmod 700 /bin/cat
chmod 700 /bin/uname
chmod 500 /bin/ps
chmod 500 /usr/sbin/lsof