Starting the sshd daemon

I looked around and couldn’t find a startup script for sshd. So I ran the script in /etc/openssh that configures the key files, then ran the daemon directly. Everything worked fine until I rebooted when (of course) the daemon wasn’t present. So I went to the /etc/rc.d/rc.local file and added

exec /opt/sbin/sshd &

and rebooted. That didn’t work. So I made an entry in the same file where ftpd and telnetd are started and rebooted… No good.

So for kicks I removed my changes and ran it by hand. Everything works fine.

There must be a trick here that I’m missing, and my guess is it has to do with PATH, but I’m not sure what’s missing.

So what is the correct method of starting the sshd daemon?

Many thanks!

-e

try to add a “sleep 10” before you start sshd in rc.local.

That worked when I put the call to sshd and the sleep into a separate script, then called the scrip from rc.local.

Oddly, though: When I ssh into the system, I see the following:

Last login: Fri Jul  9 12:31:34 2004 from saruman
Welcome to QNX Neutrino!
Bad line 1 in /etc/default/login
Bad line 2 in /etc/default/login
Bad line 4 in /etc/default/login
Bad line 5 in /etc/default/login
Bad line 6 in /etc/default/login
Bad line 7 in /etc/default/login
Fri Jul  9 12:34:16 2004 on /dev/ttyp1
Last login: Fri Jul 9 12:31:34 2004 on /dev/ttyp1
Fri Jul  9 12:34:16 2004 on /dev/ttyp1
Last login: Fri Jul 9 12:34:16 2004 on /dev/ttyp1
bash-2.05a$ 

This leaves me with a couple puzzling questions.

(1) What is /etc/default/login for? Looks like a bunch of environment vars, but not an export list
(2) Why do I get the two “Last login:” flags? (I see this latter one when I telnet into the box, too,
and whether the user’s shell is bash or sh).

Many thanks!

-e

answered here openqnx.com/PNphpBB2-viewtopic-t2578-.html