How to find ports which are in use on linux server

netstat -na | grep ‘tcp\|udp’ | awk ‘{print $4}’ | cut -d: -f2 | sort | uniq -c | awk ‘{print $2}’

Please find below the description of commands used in above string — netstat command is used to check all incoming and outgoing connections from the server. We used grep command to find out the type of connection i.e. tcp or udp. We used cut command to find out the port number from IP:port string .Sort and uniq used in combination to find out  the unique port only and at last we use awk to print the unique port in use.

Tags: netstat port listen
Posted in Linux | Tagged | Leave a comment

List of data center in India

Data center are the live line of all the companies depends on the collocation of the servers for their business. Here by I am trying to compile the list of DC providing their services in India.

1)      www.ctrls.in

2)      www.esds.co.in

3)      www.relianceidc.com

4)      www.net4.in

5)      http://www.tatacommunications.com/enterprise/datacenter/

6)      www.spectranet.in

7)      www.go4hosting.com

Tags: List of data center in India
Posted in General | Tagged | Leave a comment

How to secure your Linux Box

1) Keep the system up to date by applying all the latest update/patches.

Read news websites for bug fix and security updates. Make sure packages are signed and from the know source.

2) Delete or Disable the things you do not require on your server.

Use chkconfig or setup command for Redhat based distribution.

e.g chkconfig –del <service name>

chkconfig –del httpd

To remove packages use the rpm command rpm -e <package name>

Note: check the dependency before removing the package.

3) Setup a firewall using iptables to restricted access.

Use iptables to protect your server from unauthorized access.

e.g. Restricted access to SSH you server running on port 22 from your source IP(from which you ssh the server)

iptables -A INPUT -p tcp -i eth0 -s X.X.X.X -d 0/0 –dport 22 -j ACCEPT where X.X.X.X is source IP from you access your server using SSH running on port 22

4) Implement password policy.

Make sure you always use the strong and good passwords.

Passwords should be at least 8 characters in length and consists of one upper case, number and special character.

Try to avoid reuse of the passwords

Tags: How to secure your Linux
Posted in Linux | Tagged | Leave a comment