Simple Linux Server Security Tips
Thursday, August 18th, 2011Linux is one of the secured operating system. However, With the world of crackers (Evil minded Geeks & Hackers) Linux is also not so secure as we think.
Step 1: How to secure SSH port in Linux server?
Gaining SSH root access is the primary goal of every crackers around. Once they could get root access., They will install rookkits, keyloggers, mail bombs and etc. So, They usually try to gain access to your server using some formal password combinations. They attempt to login to your server using bruteforce method.
SSH always runs on port number 22
You have to change it to some non-default number like., 2323 or 3009 some number that is hard to guess.
/etc/ssh/sshd_config
above file is the default ssh configuration file. You can change its “Port” value by opening it using Vi or Nano. CentOS Documentation has clear information about how to change linux server ssh port to a non-standard number. This instructions applies for any redhat kernel based distro.
Step 2: Always check your /tmp folder
It is like., Checking your trash can of your bedroom for any hidden cams. Yes., Some crackers upload a *.php *.py *.sh files to your server’s /tmp file and let them to become a primary spamming bot in your server. You have to always try to find if there are any suspicious file around there in /tmp and delete them. Usually deleting the file wont pay off. You have to find the source loop hole that allows such file in /tmp . You have to audit your web applications that allows file-uploads and anonymous FTP uploads to your server.
Step 3: Disable Anonymous FTP Service
Enabling anonymous FTP service is most like., Inviting robbers by opening your house window.
/etc/proftpd.conf
/etc/vsftpdvsftpd.conf
Simply disable anonymous FTP.
Step 3: Always use SFTP and completely stop using FTP
SFTP is more secure than you think. Most windows based ftp clients such as filezilla, smartftp & coreftp could be affected by many malwares and it will upload “Trojan Horse JavaScript” code to your website files. I personally got affected my many javascript trojans because of virus infected ftp client transfers. This wiki page has clear & simple information about how to install SFTP
Step 4: How to disable direct file or image hotlinking?
Lets say you have a cool picture file in your website. http://mywebsite.com/images/picture.jpg . If a guy puts your file in his website and lets say his website has thousands of visitors per day., Then, You will be endup paying money for your excessive bandwidth. Disabling hotlink is like., Saving money in your server bandwidth. This is one of the best tool that lets your to generate .htaccess code for hotlink protection.




