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

Is this above mentioned in title possible ? I want to run one SSH server for SFTP clients (on some other port.. for ex 2121 ), and want to run other SSH server for SSH clients which will be allowed to log in only with key. Anyone have Idea how to implement this ?


share|improve this question
up vote 4 down vote accepted

Use separate config files and start one of the servers specifying the config file.

share|improve this answer
And how can I do this ? – amarc Jul 4 '10 at 16:30
See sshd(8) and read about the parameter -f: – joschi Jul 4 '10 at 16:35
You will most likely also want a separate set of init scripts, pid files, etc. Exactly how do accomplish that depends on what linux distribution you are running. Yet, different config files are the core in the solution. – andol Jul 4 '10 at 16:43
Well I run Debian Lenny.. I just did /usr/sbin/sshd -f /etc/ssh/sshd_config2 and that did start ssh on diferent port. It would be nice to have init script tho. Anything I could change quickly in original /etc/init.d/ssh to acomplish this ? tnx – amarc Jul 4 '10 at 16:45

Alternatively to the solution posted by BillThor (using two seperate configuration files) you might want to check the Match directive in sshd_config(5) which can be used apply different configurations per user/group/client IP address.

share|improve this answer
While this technically isn't what you are asking for, it does seem like the most natural solution to the problem I am guessing you are trying to solve. – andol Jul 4 '10 at 16:44

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.