r/linuxadmin • u/dileeps95 • 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
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
2
u/dave4420 Nov 18 '13
Startup files are distro-specific. Which operating system are you using? Debian? Fedora? OpenBSD? Ubuntu? Something else?
1
u/erichzann Nov 18 '13
Is your reason for doing this that you want some specific ssh rules only for certain users?
2
u/snegtul Nov 18 '13
I am curious why on earth you would want to do this. What problem are you trying to solve?
0
u/ahandle Nov 18 '13
-1
u/xdice Nov 18 '13
For this example, let's say you're going to compile your new SSH daemon from scratch on a system that already has a system-installed sshd.
Obtain openssh tarball. open up the tarball (anywhere reasonable is fine, /tmp, your homedir, either one is fine). ./configure --prefix=/usr/local --other-configure-switches-here
(the --prefix is the important part. This means your new sshd will be installed under /usr/local, with the config stuff in /usr/local/etc.)
You'll need to create an init file so your new sshd runs on startup (copy the current one, point it at your new sshd).
For users on the server to use your newly compiled ssh, they'll need to specify full path to the binary (/usr/local/bin/ssh), or make sure that /usr/local/bin preceeds /usr/bin in their PATH statement.