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 have a set of VMs, which have a network private to them, and then they each have a public IP. Is it possible to have a set of rules for the public IP (say no password authentication, non-standard port) and the have another set of rule for the private network (password authentication, port 22) for ssh?

This is on Ubuntu 10.04

share|improve this question
What operating system is this? – Evan Anderson Oct 8 '10 at 11:56
up vote 3 down vote accepted

It isn't necessary to configure a second instance for this. Check the "Match" keyword in the sshd_config manpage

share|improve this answer
I was hoping that there would be a solution like this, thank you – Dan McClain Oct 12 '10 at 17:09

Install/configure another instance of sshd to run under the different set of rules. Check out this link for hints.

share|improve this answer
upvoting because this is on the right lines. No need to install twice though, just use two config files for sshd and use -f when launcing the server (twice). – Sirex Oct 8 '10 at 12:44
I figured that this would probably be the way to have this work. – Dan McClain Oct 8 '10 at 12:45
Thanks for the clarification, Sirex; +1 to you! I didn't think that it would be necessary to install a second instance, but I don't have a *nix box to try on. Changed "Install" to "Install/Configure" – gWaldo Oct 8 '10 at 13:12

Your Answer


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.