Operating System - HP-UX
1833777 Members
2417 Online
110063 Solutions
New Discussion

sshd starting over init level

 
mario.schroeder
Frequent Advisor

sshd starting over init level

We have installed the sshd and all works fine. So now we want to add these sshd to the booting level.

In Linux (gentoo) there is something like "rc-update -a sshd boot"

How can a add the sshd to a rc-Level?
8 REPLIES 8
harry d brown jr
Honored Contributor

Re: sshd starting over init level

[root@vpart1 /tmp]# find /sbin -name "*ssh*" -exec ls -l {} \;
-rwxr-xr-x 1 root sys 1679 Jun 24 2004 /sbin/init.d/sshd2
lrwxr-xr-x 1 root sys 18 Jun 24 2004 /sbin/rc1.d/K891sshd2 -> /sbin/init.d/sshd2
lrwxr-xr-x 1 root sys 18 Jun 24 2004 /sbin/rc2.d/S891sshd2 -> /sbin/init.d/sshd2
[root@vpart1 /tmp]#

the sshd2 script is:
#! /bin/sh
# description: # SSH Tectia(tm) Server - daemon

#
# Author: Ville Laurikari
# Sami Lehtinen
#
# Copyright (c) 2000-2003 SSH Communications Security, Finland
# All rights reserved
#
#!/sbin/sh

if test ! -f //usr/local/sbin/sshd2; then
exit 0
fi

PID=""
if test -f /var/run/sshd2_22.pid; then
PID=`cat /var/run/sshd2_22.pid`
fi



rval=0
set_return() {
x=$?
if [ $x -ne 0 ]; then
echo "EXIT CODE: $x"
rval=1 always 1 so that 2 can be used for other reasons
fi
}


case $1 in
start_msg)
echo "Starting sshd2"
;;
stop_msg)
echo "Stopping sshd2"
;;
start)
if test -x //usr/local/sbin/sshd2 ; then
echo "Starting sshd2: \c"
//usr/local/sbin/sshd2
echo "OK"
set_return
if [ $rval -ne 0 ]; then
echo "Error in starting sshd2. Recommend checking the"
echo "syslog file (usually /var/adm/syslog/syslog.log)"
echo "for possible reasons."
fi
else
echo "//usr/local/sbin/sshd2 is not executable"
rval=1
fi
;;

stop)
# Stop daemons.
if test -n "$PID"; then
echo "Shutting down sshd2: \c"
kill $PID
echo "OK"
else
echo "No sshd2 process found"
rval=1
fi
if test -f "$PIDFILE"; then
rm -f $PIDFILE
fi
;;

restart)
$0 stop
$0 start
;;
*)
echo "Usage: sshd2 {start|stop|restart}"
rval=1
esac

exit $rval


live free or die
harry d brown jr
Live Free or Die
Gary L. Paveza, Jr.
Trusted Contributor

Re: sshd starting over init level

If you installed the HP depot, then this is already done for you. The script is /sbin/init.d/secsh. It has links at /sbin/rc2.d/S393secsh to start.
mario.schroeder
Frequent Advisor

Re: sshd starting over init level

So we have installed the HP-Depot but there are no files like /sbin/secsh

# find /sbin -name "*ssh*" -exec ls -l {} \;
lrwxr-xr-x 1 root sys 23 May 23 16:19 /sbin/init.d/sshd -> /opt/openssh2/sbin/sshd
lrwxr-xr-x 1 root sys 17 May 23 16:19 /sbin/rc3.d/S991sshd -> /sbin/init.d/sshd



And the link to the /opt/openssh2/sbin/sshd ist only a binary file - is this coorect

schroedi
Gary L. Paveza, Jr.
Trusted Contributor

Re: sshd starting over init level

The script is in /sbin/init.d and is called secsh (secure shell).
mario.schroeder
Frequent Advisor

Re: sshd starting over init level

Yes, I know but we have not those script in
our directory

----%<---------------
-r-xr-xr-x 1 bin bin 1483 Nov 14 2000 rwhod
-r-xr-xr-x 1 bin bin 584 Sep 13 2001 samba
-r-xr-xr-x 1 bin bin 3842 Nov 14 2000 savecrash
-r-xr-xr-x 1 bin bin 2217 Jan 22 2002 scrdaemon
-r-xr-xr-x 1 bin bin 3688 Nov 14 2000 sendmail
-r-xr-xr-x 1 bin bin 1524 Nov 14 2000 set_date
-r-xr-xr-x 1 bin bin 710 Nov 14 2000 set_prvgrp
-r-xr-xr-x 1 bin bin 1275 Oct 5 2004 slsd
-r-xr-xr-x 1 bin bin 1423 Nov 14 2000 spa
lrwxr-xr-x 1 root sys 23 May 23 16:27 sshd -> /opt/openssh2/sbin/sshd
-r-xr-xr-x 1 root sys 483 Mar 26 2004 start_umc
-r-xr-xr-x 1 bin bin 454 Aug 26 2002 stop_psp
-r-xr-xr-x 1 root sys 489 Aug 26 2002 stop_umc
-r-xr--r-- 1 bin bin 2750 May 7 2002 swagentd
-r-xr-xr-x 1 bin bin 785 Nov 14 2000 swap_start
-r-xr--r-- 1 bin bin 32195 Jul 29 2002 swconfig
-r-xr-xr-x 1 bin bin 1312 Nov 14 2000 syncer
-r-xr-xr-x 1 bin bin 3047 Oct 27 2003 syslogd
-r-xr-xr-x 1 bin bin 3214 Nov 14 2000 template

----------------%<---------------------------
Gary L. Paveza, Jr.
Trusted Contributor

Re: sshd starting over init level

You have /opt/openssh2 listed as a link to ssh. That doesn't look like the HP depot for secure shell. Did you compile it yourself? HP's is product T1471AA and is found on software.hp.com
mario.schroeder
Frequent Advisor

Re: sshd starting over init level

I have not installed the Depot. But I dont think that the depot was self compiled.

#swlist -l product | grep -i ssh
openssh 3.7.1p2 openssh
Gary L. Paveza, Jr.
Trusted Contributor

Re: sshd starting over init level

You may want to deinstall that bundle and install these two:

Secure Shell
http://www.software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA

Random Number Generator
http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=KRNG11I

Random number generator needs a reboot to install.