OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: 2 sshDs - Automaticly startup after a boot... <-X-> Forcing the 1st SSHd to use DSA-Keys, the 2nd works well

From: vh (vhhelith.net)
Date: Sun Jan 02 2005 - 18:50:41 CST


On Sun, 2 Jan 2005 23:57:41 +0100
Ingo Schwarze <schwarzeusta.de> wrote:

> Hi vh,
>
> > So where should I add another sshD
> > if I like to start 2 sshD during the boot-process?
>
> Whenever you intend to start your own daemon processes,
> the standard place to do that is /etc/rc.local(8) .
>
> If you really want two distinct instances of sshd with different
> configurations on one single machine, you might consider to set
>
> sshd_flags=NO
>
> in /etc/rc.conf(8) (along with some comment in that file)
> and start *both* of them in /etc/rc.local - that's probably
> easier to maintain than having the configuration options
> for the two instances spread across two different files.
>
> > ps. Now I'm ssh-less ;)
> > Are there some other admins out there who had that problem already?
> > :)
>
> Definitely yes.
>
> The following is a quite common mistake:
>
> rootfaraway # vi /etc/ssh/sshd_config
> rootfaraway # kill -HUP `cat /var/run/sshd.pid`
> rootfaraway # exit
> luserhome $ ssh faraway
> ssh: connect to host faraway port 22: Connection refused
>
> What happened? Probably /etc/ssh/sshd_config was screwed up,
> for example by some typo, so the -HUP killed off the old
> daemon, but the new one failed to come up again.
>
> I heard this story more than once, even from people who cannot
> be called newbies at all. Yes, of course you use ps(1) both
> before and after every kill -HUP, and of course you will first
> try to open a second ssh connection from home to faraway before
> you exit the last remote shell you still have. You *always* do
> that. Of course you do! Except... Oh well...
>
> Yours,
> Ingo

Thanks for all answers!
I treid to start 2 sshDs via rc.conf (not rc.local).
Maxim Bourmistrov wrote:

--
cat /etc/rc.conf :
sshd_flags="" # for normal use: ""
sshd_debug=YES

cat /etc/rc.local:

if [ X"${sshd_debug}" == X"YES" ]; then
        echo -n ' sshd-debug'
        /usr/sbin/sshd -f /etc/ssh/sshd_debug
fi
--

I just used 2 times sshd_flags=xyz
1st: sshd_flags="-f /etc/ssh/sshd_config" #Mainserver
2nd: sshd_flags="-f /etc/ssh/sshd_config_users" #2nd Server

It is the same phy. Server but include the sshd_configs there 2 diffrent
IPs. So I wonder that the server started the 2nd sshD for the user-sshD
(wich works well) but not the 1st sshD for the mainserver.

I think the 2nd sshd_config "overwrote" the 1st sshd_config even I don't
know why. I'll try Maxim Bourmistrovs Idea even I don't know why my
rc.conf failed.

To be precise: I don't see any line in the rc.conf wich prohebit the
followring:

sshd_flags="-f /etc/ssh/sshd_config"
sshd_flags="-f /etc/ssh/sshd_config_users"

Both configurations are the same.
The only difference is the IP the server listen on and the keys it use.
And much more suspect: Because the configuration is the same: Why does
the User-sshD use DSA-Keys but the primary server dosn't?

It makes me a littlebit nervous because I maybe did something wrong
even I don't see any misstakes in the sshD-config (I posted it already).
:-/

But I'll try Maxims Idea after a nice guy enabled sshD manualy. :)
Thanks for all responses and maybe somebody is able to tell me why DSA
works for the 2nd Server but not for the 1st even the configuration is
the same.

Friendly greetings,
vH

[demime 1.01d removed an attachment of type application/pgp-signature]