Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I own a vps with Ubuntu 10.04 and i want to make it just accessible to me and one friend mine through dyndns hosts. It's possible block all others ips?

share|improve this question

closed as not a real question by Wesley, Ward, John Gardeniers, MDMarra, Michael Hampton Dec 7 '12 at 15:31

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

What type of connection protocols are you using? – Publiccert Feb 19 '12 at 19:03
ssh, http and ftp – Marcus Feb 19 '12 at 19:07

First of all, check out Denyhosts. Add his(and your IP) to it and that will prevent others from connecting. Also, set 'AllowUser hisname *yourname* in sshd_config.

I wouldn't recommend ftp. Check out sftp. If you're using ssh already, you might as well use sftp too.

Blocking http is going to be trickier. Check out .htaccess but even that isn't ideal.

Most of this is for naught if you're using dynamic ips(most home connections).

share|improve this answer

If you have a software firewall (and you should), I'd suggest using that. That way, you're blocking connections lower down on the stack and you're potentially reducing the scope of vulnerabilities. Plus, malicious users would be less likely to discover network services that you don't want them to know about.

I'm personally fond of iptables myself, but others such as shorewall and ufw should work fine too. Just be careful when setting stuff up. =)

share|improve this answer
Amen to being careful during setup. A good rule of thumb is to always keep an SSH session open when pushing your changes. Then try connecting with a DIFFERENT session. Failed? Use your existing session to roll-back changes. – Publiccert Feb 25 '12 at 22:22

If you have dynamic IPs from your ISPs, what I presume because you what to use dyndns, it's not possible afaik. Problem: in a firewall ruleset you have to specify your IPs and these change in your case.

If you have static IPs the other answers are good.

share|improve this answer

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