Hi all,

i have a bit of a problem.
it happens every time i start sshd2 daemon (sshd2: SSH Secure Shell
3.0.1 (non-commercial version) on i586-pc-linux-gnu) which is compiled
with tcpwrappers, and uses 2048 bit RSA keys for ssh1 protocol.

if i try to used ssh2 to connect to the server it takes my password and
then kick's me out, which is probably a config and/or a set-up problem.
i have bigger problems right now, so i'll leave this one for some other
time.

if i use ssh1 it allows me to log in once. but as soon as the initial
session is done, the daemon terminates.
i am obviously not starting it right (daemon /usr/local/sbin/sshd &),
but i can't find the problem in the script
which i put together from the scripts that were mailed to me (thank you
for your input) by some of you (i posted a message
that i lost mine script a week ago or so).

So what am i doing wrong this time?

here is the /etc/rc.d/init.d/sshd file:

#!/bin/sh
#
# /etc/rc.d/init.d/sshd  --  start/stop the ssh daemon.
PATH=/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/bin:/usr/bin

# Source function library.
. /etc/rc.d/init.d/functions

# Determine the port daemon wants to use
PORT=`grep Port /etc/ssh2/sshd2_config | awk '{x = $2} END {print x}' -`

# If Port field is empty fall back to default -> 22
if [ "X$PORT" = "X" ]; then
        PORT = 22
fi


RETVAL=0

case "$1" in
  start)
        if [ -x /usr/local/sbin/sshd ]; then
                echo -n "Starting SSH Daemon (sshd2) on port $PORT ..."
                daemon /usr/local/sbin/sshd &
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sshd2_$PORT
                echo
        fi
        ;;
  stop)
        echo -n "Shutting Down SSH Daemon (sshd2) on Port $PORT ..."
        kill -TERM `cat /var/run/sshd2_$PORT.pid`
        RETVAL=$?
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sshd2_$PORT
        echo
        ;;
  restart|force-reload)
        $0 stop >/dev/null
        sleep 2 && echo "sshd2 is comming back on-line on port $PORT
..."
        $0 start >/dev/null
        ;;
  status)
        status sshd
        RETVAL=$?
        ;;
  *)
        echo "Usage: sshd {start|stop|restart|force-reload|status}"
        RETVAL=1
        ;;
esac
exit $RETVAL

--
Regards,

Aleksander V Maslov

5 Hampton Court, Apt B
Jersey City, NJ 07302

phone: 201-938-1186
email: [EMAIL PROTECTED]
web:    http://pegasus.rutgers.edu/~amaslov

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to