Some random tips you would like to know about AWS EC2

I have been writing posts about AWS. And after so long again I am writing yet another post which is a compilation of tips and tricks you would love to do to secure your EC2 instance. Securing and EC2 instance is much more similar like any other operating systems. Here I am writing about some tips I recently did on one of a Linux EC2 instance.

Here are gist snippet tips that you can use to secure your Linux Server.
Install mod security module
yum install mod_security
service httpd restart

SSH configuration to enable keys for some users and passwords for some users
#/etc/ssh/sshd_config
#ec2-user and root uses key file for login
Match User ec2-user,root
PasswordAuthentication no
#testuser uses password for login
Match User testuser
PasswordAuthentication yes
view raw sshd_config hosted with ❤ by GitHub

Disable mysql history
rm $HOME/.mysql_history
ln -s /dev/null $HOME/.mysql_history

Installing mod_evasive for DOS attack prevention
yum install httpd-devel
wget wget http://www.zdziarski.com/blog/wp-content/uploads/2010/02/mod_evasive_1.10.1.tar.gz 
tar -xzf mod_evasive_1.10.1.tar.gz 
cd mod_evasive 
apxs -cia mod_evasive20.c 
#/etc/httpd/conf.d/mod_evavsive.conf
LoadModule evasive20_module /usr/lib64/httpd/modules/mod_evasive20.so
<IfModule mod_evasive20.c>
DOSHashTableSize 3097
DOSPageCount 3
DOSSiteCount 100
DOSPageInterval 3
DOSSiteInterval 5
DOSBlockingPeriod 300
DOSLogDir "/var/log/httpd/modevasive/"
DOSEmailNotify someone@somewhere.com
</IfModule>

Comments

Popular posts from this blog

Automate file upload in Selenium IDE

How To Install and Configure Nextcloud

Google translate adds Nepali Language Conversion