Quantcast
Channel: Linux Candy » homepost
Viewing all articles
Browse latest Browse all 10

Securing Your Linux Box

$
0
0

Securing a linux box ? I must be kidding. We all know that linux is far pre-secured than any other OS present today. But wait, we are not talking about security like being secured from virus or malware etc. We are connected to internet 24 bar 7 and hence there a number of things to be learnt in here. There are multiple things happening around when we just open a link for eg. facebook.com . Unknowingly we might be sending unsecured packets from our PC which others can take benefit of and in other way we might be receiving packets which might damage our computer. So, today, wei will share about securing your linux box. Its easy and fast way to secure your box.

1. Keep your box still up to date
This is important because the update manager will patch many bug when you update your box. But its going to be bad if some packages are updated and still it has bug ( LOL ) .

2. Do not Block needed port
If you do this, other box cannot access your blocked port service. Its really…really… important when you’re on network.
You can do this with firewall. Iptables is the best choice, right?
For example: if you want to block SSH access. Just type:

iptables -A INPUT -p tcp –dport 22 -j DROP

for other port you just have tochange the number of port. And to have this command working on startup, you can add this to the command-

/etc/rc.local

3. Change SSH default port number
This is tricky. Everybody knows that ssh has default port 22. So one who wants to harm you may try some attacks being sure and based on port 22. So the trick is to change the port to something else of your choice and you are safe :) .

The configuration port for SSH is on /etc/ssh/sshd_config

gedit /etc/ssh/sshd_config

change the default port (22) to other number, up to you :D
save, and restart the ssh service.

4. Use Antivirus
Ok don’t shout at me for saying you linux is virus free. Well in my more than 5 years of linux experience I haven’t come across any. But there are few linux virus made. Why to take risk ? Prevention is better than cure. Here are some antivirus for you for linux box:

Avira

Avast

ClamAv

AVG

F-Prot

5. Deny SSH login with User Root
root is very common for all. Any fool trying to login in your box via ssh will first try to login via root, so disable the login and let the fools keep trying.
gedit /etc/ssh/sshd_config

change PermitRootLogin yes to PermitRootLogin no

6. Deny ALL (additional)

gedit /etc/hosts.deny

at end of this file you will see #ALL: PARANOID
change to

ALL: ALL on /etc/hosts.allow
you can allow the host or domain that allow to access to your box.

 

Congratulations. Your network is safer than before. \m/


Viewing all articles
Browse latest Browse all 10

Trending Articles