Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I'm new to Linux and security matters. I have a vps with Ubuntu 12.04 server and I wonder how secure this server is.

I set up ssh passwordless login and disabled ssh login for root. I update security packages. I don't use a firewall. There are only two services which listen for external incoming connections:

~ > sudo netstat -tupln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1272/nginx
tcp        0      0 127.0.0.1:41333         0.0.0.0:*               LISTEN      1232/domain.lighttpd
tcp        0      0 127.0.0.1:4949          0.0.0.0:*               LISTEN      908/munin-node
tcp        0      0 0.0.0.0:21012           0.0.0.0:*               LISTEN      807/sshd
tcp6       0      0 :::21012                :::*                    LISTEN      807/sshd

Is my system secure? Is it worth to use a firewall to shield these two services?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

Firewall does not shield services that need to be accessible from the network.

Is this a VM or a container VPS? If it's a container based VPS (done using OpenVZ or vserver), then you are quite limited in what you can do to improve security. If it's a VM, you can install a kernel patched with Grsecurity and use a MAC solution like TOMOYO, AppArmor or SELinux to isolate your services.

With passwordless login I presume you use keys? Also you need to learn more about the services you are running that are exposed to the network (nginx and ssh). Learn configuration files and what options you have.

Read man pages for config files. Certain configuration options (and combinations of) can lead to a vulnerable system.

Your system will always be insecure until you (admin) know your system, dangers and security mechanisms at your disposal.

share|improve this answer
1  
+1 ... especially for your last sentence! –  Rory Alsop Jul 9 '12 at 8:18
    
VDS on Hyper-V. Can I install the kernel patched with Grsecurity? Thank you for pointing me at services isolation! Just going to dive in AppArmor. Yes, passwordless means authentication by rca key. I'm learning my system every day, and there is much to learn indeed. Thank you Rory! –  zuba Jul 9 '12 at 8:34
    
To install kernel patched with Grsecurity, you need to download the kernel source, Grsecurity patch, patch the kernel, configure kernel, compile kernel and then you install it. Grsecurity has a patch for 3.2.22 kernel, so download that. Ubuntu 12.04 also uses 3.2, so you should be able to use the old config without problems. There are plenty of resources on how to compile a kernel on Ubuntu, just search for them. –  Matrix Jul 9 '12 at 12:49
    
Thank you Matrix! –  zuba Jul 9 '12 at 13:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.