OpenSSL 1.0.0 OpenSSHにアップグレード5.5 p 1のシナリオ


OS:linux5.3 x86_64   linux5.5 x86_64

  
  
  
  
  1. #!/bin/bash  
  2. ############################################################  
  3. ####      update openssl openssh script             ########  
  4. ####              Author:hx10                        #######  
  5. ####warining:start telnet service before use this script####  
  6. ############################################################  
  7. sleep 5  
  8. export PATH=$PATH:/sbin/  
  9. ####add yum source #####  
  10. rm -rf /etc/yum.repos.d/*.repo  
  11. wget http://192.168.0.141:8000/linux5_5_x86_64.repo -O /etc/yum.repos.d/linux5_5_x86_64.repo  
  12. sed -i 's/yes/no/g' /etc/xinetd.d/telnet  
  13. yum -y install telnet-server  
  14.  
  15. service xinetd restart  
  16. service sshd stop  
  17. echo "exclude=*.i?86" >>/etc/yum.conf  
  18. yum -y remove openssl-devel openssh  
  19. yum -y install pam-devel  
  20. cd /usr/local/src  
  21. #wget http://www.openssl.org/source/openssl-1.0.0.tar.gz  
  22. #wget http://openbsd.org.ar/pub/OpenBSD/OpenSSH/portable/openssh-5.5p1.tar.gz  
  23. #wget http://www.sfr-fresh.com/unix/misc/zlib-1.2.5.tar.bz2  
  24. wget http://192.168.0.21:8000/openssl-1.0.0.tar.gz  
  25. wget http://192.168.0.21:8000/openssh-5.5p1.tar.gz  
  26. wget http://192.168.0.21:8000/zlib-1.2.5.tar.bz2  
  27. ####install zlib1.2.5########  
  28. tar -jxvf zlib-1.2.5.tar.bz2  
  29. cd zlib-1.2.5  
  30. ./configure --prefix=/usr/local/zlib -share  
  31. make && make install  
  32. echo "/usr/local/zlib/lib" >>/etc/ld.so.conf  
  33. ldconfig -v  
  34. cd ..  
  35. ####install openssl-1.0.0########  
  36. tar -zxvf openssl-1.0.0.tar.gz  
  37. cd openssl-1.0.0  
  38. ./config shared zlib-dynamic --prefix=/usr/local/openssl --with-zlib-lib=/usr/local/zlib/lib --with-zlib-include=/usr/local/zlib/include  
  39. make && make install  
  40. echo "/usr/local/openssl/lib64" >>/etc/ld.so.conf  
  41. ldconfig -v  
  42. cd ..  
  43. ####install openssh5.5p1########  
  44. tar -zxvf openssh-5.5p1.tar.gz  
  45. cd openssh-5.5p1  
  46. mv /usr/bin/openssl /usr/bin/openssl.OFF  
  47. mv /usr/include/openssl /usr/include/openssl.OFF  
  48. ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl  
  49. ln -s /usr/local/openssl/include/openssl /usr/include/openssl  
  50. mv /lib64/libcrypto.so.4  /lib64/libcrypto.so.4.OFF  
  51. mv /lib64/libssl.so.4   /lib64/libssl.so.4.OFF  
  52. ln -s /usr/local/openssl/lib64/libcrypto.so.1.0.0 /lib64/libcrypto.so.4  
  53. ln -s /usr/local/openssl/lib64/libssl.so.1.0.0 /lib64/libssl.so.4  
  54. mv /usr/lib64/libcrypto.so  /usr/lib64/libcrypto.so.OFF  
  55. mv /usr/lib64/libssl.so   /usr/lib64/libssl.so.OFF  
  56. ln -s /usr/local/openssl/lib64/libcrypto.so  /usr/lib64/libcrypto.so  
  57. ln -s /usr/local/openssl/lib64/libssl.so  /usr/lib64/libssl.so  
  58. ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-ssl-dir=/usr/local/openssl --with-md5-passwords --mandir=/usr/share/man --with-zlib=/usr/local/zlib --without-openssl-header-check  
  59. make && make install  
  60. cp ./contrib/redhat/sshd.init /etc/init.d/sshd  
  61. chmod +x /etc/init.d/sshd  
  62. chkconfig sshd on  
  63. service sshd start  
  64. openssl version -a  
  65. ssh -v  
  66. exit 

sshdを再起動すると次のようにエラーが発生します.
Stopping sshd:                                             [  OK  ] Starting sshd:WARNING: initlog is deprecated and will be removed in a future release
解決策:
vim/etc/init.d/sshd 107行検出
#注記下行#initlog-c"$SSHD$OPTIONS"&&success|failure#下行$SSHD$OPTIONS&&success|failure