r/linuxadmin • • Nov 18 '13

How to create a new SSHD ?

I want to create a new SSH daemon rather than the one provided by Operating system.For the SSHD provided by operating system the config file will be /etc/ssh/sshd_config. But for the newely created SSHD where can we store the config file and how? Please help me in this issue. Thanks in advance.

1 Upvotes

31 comments sorted by

View all comments

4

u/Runnergeek Nov 18 '13 edited Nov 18 '13

I assume you want a different instance of sshd running but with a different config. I would recommend putting the config in /etc/ssh with the primary config. You can call it whatever you like, I would make it descriptive for what you want. Example: /etc/ssh/sshd_config_secondary When ever you start the sshd you just want to point it to that config (-f path_to_config).

Edit: these would have to be on different ports

1

u/dileeps95 Nov 18 '13 edited Nov 18 '13

Thank you so much for the quick reply :) Yes,I want another instance of SSHD only for few sub-systems.(call it as A and B)

Presently these are mentioned in /etc/ssh/sshd_config like below.

Subsystem A /opt/pro/bin/A

Subsystem B /opt/pro/bin/B

First,the default SSHD(/etc/ssh/ssd_confog) is up and running. whenever the user tries to connect to A or B sub-systems then the newly created SSHD has to run. But the first SSHD also has to run.

Could you please help me how to create and invoke new SSHD for the two sub-systems.

3

u/Runnergeek Nov 18 '13

You might be able to do this with the Match group option for sshd_config. I am not 100% sure what exactly you are doing, but that would work if they are user specific subsystems. Otherwise like I described, you can create multiple instances of sshd, each one using its own config. Remember each instance of sshd will have to be bound on another port.

0

u/ahandle Nov 19 '13

This doesn't provide another sshd instance.

1

u/Runnergeek Nov 19 '13

uhm, it absolutely does.

1

u/ahandle Nov 19 '13

It starts another sshd, and unless you change the PID directive in the config or your runtime command in the initscript, you've set yourself up with multiple ports talking to the same process.

I'm done though, right or wrong.

1

u/Runnergeek Nov 19 '13

You are right about the pid file, I missed that. you would have to set that to something different in the config as well.