On 13 Aug, John Clarke wrote:
>  My RH 7.0, 7.3 and 9.0 systems all contain code in /etc/init.d/sshd to 
>  generate all three keys if they don't exist.  For some reason yours 
>  isn't creating the v1 key.  Run the script with sh -x and you should be 
>  able to figure out why not. 

As I expected, it's not generating them because I had already done so
manually.  Removing them and running it again doesn't help; the script
regenerates the keys and then starts up sshd, which gives the usual
error message.

luke

[EMAIL PROTECTED] etc]# sh -x /etc/rc.d/init.d/sshd restart
+ . /etc/rc.d/init.d/functions
++ TEXTDOMAIN=initscripts
++ TEXTDOMAINDIR=/etc/locale
++ umask 022
++ export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
++ PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
++ '[' -z '' ']'
++ COLUMNS=80
++ '[' -f /etc/sysconfig/i18n -a -z '' ']'
++ . /etc/sysconfig/i18n
+++ LANG=en_US
+++ SUPPORTED=zh_CN.GB2312:zh_CN:zh:en_AU:en:en_GB:en:en_US:en:[EMAIL 
PROTECTED]:fr_FR:fr:[EMAIL PROTECTED]:de_DE:de:el_GR:el:ja_JP.eucJP:ja_JP:ja
+++ SYSFONT=lat0-sun16
+++ SYSFONTACM=iso01
+++ /sbin/consoletype
++ '[' en_US = ja_JP.eucJP -a pty '!=' pty ']'
+++ /sbin/consoletype
++ '[' en_US = ko_KR.eucKR -a pty '!=' pty ']'
+++ /sbin/consoletype
++ '[' en_US = zh_CN.GB2312 -a pty '!=' pty ']'
+++ /sbin/consoletype
++ '[' en_US = zh_TW.Big5 -a pty '!=' pty ']'
++ export LANG
++ '[' -z '' ']'
++ '[' -f /etc/sysconfig/init ']'
++ . /etc/sysconfig/init
+++ BOOTUP=color
+++ RES_COL=60
+++ MOVE_TO_COL=echo -en \033[60G
+++ SETCOLOR_SUCCESS=echo -en \033[1;32m
+++ SETCOLOR_FAILURE=echo -en \033[1;31m
+++ SETCOLOR_WARNING=echo -en \033[1;33m
+++ SETCOLOR_NORMAL=echo -en \033[0;39m
+++ LOGLEVEL=3
+++ PROMPT=yes
++ '[' -x /sbin/consoletype ']'
+++ consoletype
++ '[' pty = serial ']'
++ '[' color '!=' verbose ']'
++ INITLOG_ARGS=-q
+ '[' -f /etc/sysconfig/sshd ']'
+ RETVAL=0
+ prog=sshd
+ KEYGEN=/usr/bin/ssh-keygen
+ SSHD=/usr/sbin/sshd
+ RSA1_KEY=/etc/ssh/ssh_host_key
+ RSA_KEY=/etc/ssh/ssh_host_rsa_key
+ DSA_KEY=/etc/ssh/ssh_host_dsa_key
+ PID_FILE=/var/run/sshd.pid
+ stop
+ echo -n 'Stopping sshd:'
Stopping sshd:+ killproc /usr/sbin/sshd -TERM
+ RC=0
+ '[' 2 -eq 0 ']'
+ notset=0
+ '[' -TERM '!=' '' ']'
+ killlevel=-TERM
+ base=sshd
++ pidofproc /usr/sbin/sshd
++ base=sshd
++ '[' 1 = 0 ']'
++ '[' -f /var/run/sshd.pid ']'
++ local line p pid=
++ read line
++ '[' -z '' -a -d /proc/10718 ']'
++ pid= 10718
++ '[' -n ' 10718' ']'
++ echo 10718
++ return 0
+ pid=10718
+ '[' -z 10718 ']'
+ '[' -n 10718 ']'
+ '[' color = verbose ']'
+ '[' 0 -eq 1 ']'
+ checkpid 10718
+ kill -TERM 10718
+ RC=0
+ '[' 0 -eq 0 ']'
+ success 'sshd -TERM'
+ '[' -z '' ']'
+ initlog -q -n /etc/rc.d/init.d/sshd -s 'sshd -TERM' -e 1
+ '[' color '!=' verbose ']'
+ echo_success
+ '[' color = color ']'
+ echo -en '\033[60G'
                                                           + echo -n '[  '
[  + '[' color = color ']'
+ echo -en '\033[1;32m'
+ echo -n OK
OK+ '[' color = color ']'
+ echo -en '\033[0;39m'
+ echo -n '  ]'
  ]+ echo -ne '\r'
+ return 0
+ return 0
+ '[' 0 = 1 ']'
+ return 0
+ RETVAL=0
+ '[' 0 = 0 ']'
+ rm -f /var/lock/subsys/sshd
+ echo

+ start
+ do_rsa1_keygen
+ '[' '!' -s /etc/ssh/ssh_host_key ']'
+ echo -n 'Generating SSH1 RSA host key: '
Generating SSH1 RSA host key: + /usr/bin/ssh-keygen -q -t rsa1 -f 
/etc/ssh/ssh_host_key -C '' -N ''
+ chmod 600 /etc/ssh/ssh_host_key
+ chmod 644 /etc/ssh/ssh_host_key.pub
+ success 'RSA1 key generation'
+ '[' -z '' ']'
+ initlog -q -n /etc/rc.d/init.d/sshd -s 'RSA1 key generation' -e 1
+ '[' color '!=' verbose ']'
+ echo_success
+ '[' color = color ']'
+ echo -en '\033[60G'
                                                           + echo -n '[  '
[  + '[' color = color ']'
+ echo -en '\033[1;32m'
+ echo -n OK
OK+ '[' color = color ']'
+ echo -en '\033[0;39m'
+ echo -n '  ]'
  ]+ echo -ne '\r'
+ return 0
+ return 0
+ echo

+ do_rsa_keygen
+ '[' '!' -s /etc/ssh/ssh_host_rsa_key ']'
+ echo -n 'Generating SSH2 RSA host key: '
Generating SSH2 RSA host key: + /usr/bin/ssh-keygen -q -t rsa -f 
/etc/ssh/ssh_host_rsa_key -C '' -N ''
+ chmod 600 /etc/ssh/ssh_host_rsa_key
+ chmod 644 /etc/ssh/ssh_host_rsa_key.pub
+ success 'RSA key generation'
+ '[' -z '' ']'
+ initlog -q -n /etc/rc.d/init.d/sshd -s 'RSA key generation' -e 1
+ '[' color '!=' verbose ']'
+ echo_success
+ '[' color = color ']'
+ echo -en '\033[60G'
                                                           + echo -n '[  '
[  + '[' color = color ']'
+ echo -en '\033[1;32m'
+ echo -n OK
OK+ '[' color = color ']'
+ echo -en '\033[0;39m'
+ echo -n '  ]'
  ]+ echo -ne '\r'
+ return 0
+ return 0
+ echo

+ do_dsa_keygen
+ '[' '!' -s /etc/ssh/ssh_host_dsa_key ']'
+ echo -n 'Starting sshd:'
Starting sshd:+ initlog -c '/usr/sbin/sshd '
Disabling protocol version 1. Could not load host key
+ success
+ '[' -z '' ']'
+ initlog -q -n /etc/rc.d/init.d/sshd -s '' -e 1
+ '[' color '!=' verbose ']'
+ echo_success
+ '[' color = color ']'
+ echo -en '\033[60G'
                                                           + echo -n '[  '
[  + '[' color = color ']'
+ echo -en '\033[1;32m'
+ echo -n OK
OK+ '[' color = color ']'
+ echo -en '\033[0;39m'
+ echo -n '  ]'
  ]+ echo -ne '\r'
+ return 0
+ return 0
+ RETVAL=0
+ '[' 0 = 0 ']'
+ touch /var/lock/subsys/sshd
+ echo

+ exit 0


-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to