On Sun, Jan 16, 2000 at 02:05:27PM -0600, T. Weston Sewell wrote:
> I've been trying to get sshd (the daemon not the client) working on my
> system but I'm having trouble with the keygen.  I run keygen and when it
> asks me what file to save the key in I tell it /etc/ssh_host_key (right?),
> even though the default is $HOME/.ssh/identity.  But when I try to start
> sshd it tells me  Could not load host key: /etc/ssh_host_key.  Check path
> and permissions.  In desperation I even tried chmod a+r on the file but
> still the same prob.  I would like to get a look at the source so I'd know
> what kind of error causes this problem, other than the obvious, but of
> course I only have the bin rpm for it.  Anybody have this working or know
> what I can try?  The rpm I'm using is ssh-1.2.16-1us.i386.rpm, and the
> client from that package works fine  :)  TIA.

as root, run this:

rm -f /etc/ssh_host_key*
ssh-keygen -b 1024 -f /etc/ssh_host_key -N ''

pay attention to the output (there shouldn't be any from the rm, and only
about three lines saying it's making the key and generating p and q from
ssh-keygen) 

If you want the source, get it from the "source" :

ftp://ftp.cs.hut.fi/pub/ssh

don't bother with 1.2.16 if you can help it, building ssh is _very_ easy,
so go ahead and grab 1.2.27
(ftp://ftp.cs.hut.fi/pub/ssh/ssh-1.2.27.tar.gz). Do these steps and you'll
be good to go:

rpm -e ssh       # remove the 1.2.16 that's there
rm -f /etc/ssh*  # back these up if you have configured them since
                 # installing the rpm

# these steps can be run by any user
cd /tmp
tar -xzvf ~/ssh-1.2.27.tar.gz
cd ssh-1.2.27
./configure
make
# this step should be run as root, ie. su root -c 'make install'
make install

the make install will generate your host keys, and install the daemon in
/usr/local/sbin/sshd.  You will still need an init script, like this one:

#!/bin/sh
# copy this to /etc/rc.d/init.d/sshd (RedHat et al)
# then run /etc/rc.d/init.d/sshd relink to set up symlinks

case $! in 
  start)
    echo "Starting Secure Shell service"
    /usr/local/sbin/sshd
    ;;
  stop)
    echo "Stopping Secure Shell service"
    killall sshd
    ;;
  relink)
    ln -s ../init.d/sshd /etc/rc.d/rc0.d/K00sshd 2>/dev/null
    ln -s ../init.d/sshd /etc/rc.d/rc1.d/K00sshd 2>/dev/null
    ln -s ../init.d/sshd /etc/rc.d/rc2.d/K00sshd 2>/dev/null
    ln -s ../init.d/sshd /etc/rc.d/rc3.d/S90sshd 2>/dev/null
    ln -s ../init.d/sshd /etc/rc.d/rcS.d/K00sshd 2>/dev/null
    ln -s ../init.d/sshd /etc/rc.d/rc6.d/K00sshd 2>/dev/null
    ;;
  *)
    echo "Usage: $0 {start|stop}"
    ;;
esac
-- 
_____________________   _                    _   _________________________
         Michael Rice  |_|    Collective    |_|  http://www.colltech.com
   [EMAIL PROTECTED]    |_  Technologies  _|    8007598888/8019292 pager 
           Consultant      []            []      "The Power Of Many Minds"   
---------------------------------------------------------------------------
Send administrative requests to [EMAIL PROTECTED]

Reply via email to