Centos系统下载大全 | Redhat系统下载大全 | Windows2012系统下载大全 | Windows2008系统下载大全| CMS教程 | 网站地图 51运维网-专注Linux/Unix系统安全运维!
当前位置:51运维网 > 教程 > Linux网络管理 > 正文

升级openssh_6.7p1 ssl_1.0.1j

时间:2015-01-04 20:50 来源:未知 作者:www.51ou.com 阅读:

#!/bin/sh

 

CHECK_RUN()

{

if [ "$?" = "0" ]; then

  echo "=============== Run [$1] succeed! ==============="

  sleep 3

else

  echo "Error, abort!"

  exit 2

fi 

}

 

./telnet_restart.sh  start

./telnet_restart.sh  status

sleep 3

echo " "

echo  " "

 

 

USER=`whoami`

if [ $USER != root ]; then

  echo "Must be root to run this script, please login as root and re-try"

  exit

fi

# see if configuration is already being applied

if [ -f "/etc/updatessh_6.7.conf" ]; then

  sshd -v

  echo

  echo "***************************"

  echo -n "Update openssh has already been applied, do you want to update(Y/N)?"

  read RET_SURE

  if [ "$RET_SURE" != "Y" ] && [ "$RET_SURE" != "y" ]; then

echo "Abort upate!"

exit;

  fi 

else

  echo "Starting to update openssh..."

fi

 

if [ "$1" != "OK" ]; then

echo "parameter error, abort!"

exit 1

fi

 

 

cat /etc/issue | grep -i 'centos release 6.4' > /dev/null

if [ $? = "0" ]; then

PAM_RPM="./pam-devel-1.1.1-13.el6.x86_64.rpm"

fi 

 

 

WORK_DIR=`pwd`

 

if [ ! -f $PAM_RPM ]; then

echo "No find pam-devel package, abort!"

exit 1

fi

 

rpm -ivh $PAM_RPM

 

cat /etc/issue | grep -i 'centos release 6' > /dev/null

if [ $? = "0" ]; then

  rpm -qa | grep pam-devel > /dev/null

  if [ $? != "0" ]; then

     echo "Warning: NO install pam-devel RPM package, abort!"

     exit 1

  fi

fi 

 

umask 0022

 

tar xvzf zlib-1.2.8.tar.gz

cd zlib-1.2.8

./configure --prefix=/usr/local/zlib

CHECK_RUN "configure_zlib"

make

CHECK_RUN "make_zlib"

make install

CHECK_RUN "install_zlib"

 

cd $WORK_DIR

tar xvzf openssl-1.0.1j.tar.gz

cd openssl-1.0.1j

./config shared zlib  --prefix=/usr/local/openssl

CHECK_RUN "configure_openssl"

make

CHECK_RUN "make_openssl"

make install

CHECK_RUN "install_openssl"

 

mv /usr/bin/openssl /usr/bin/openssl.old

mv /usr/include/openssl /usr/include/openssl.old

ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl

ln -s /usr/local/openssl/include/openssl /usr/include/openssl

ln -sf /usr/local/openssl/lib/libcrypto.so.1.0.0 /lib/libcrypto.so.6

echo "/usr/local/openssl/lib" >>/etc/ld.so.conf 

ldconfig -v

CHECK_RUN "ldconfig"

 

cd $WORK_DIR

tar xvzf openssh-6.7p1.tar.gz 

cd openssh-6.7p1

./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib=/usr/local/zlib
--with-ssl-dir=/usr/local/openssl/ --with-md5-passwords

CHECK_RUN "configure_openssh"

make 

CHECK_RUN "make_openssh"

make install 

CHECK_RUN "install_openssh"

 

# modify configuration

sed -i -e "s/GSSAPIAuthentication yes/#GSSAPIAuthentication yes/g"  /etc/ssh/sshd_config

sed -i -e "s/GSSAPICleanupCredentials yes/#GSSAPICleanupCredentials yes/g"  /etc/ssh/sshd_config

sed -i -e "s/##GSSAPICleanupCredentials yes/#GSSAPICleanupCredentials yes/g"  /etc/ssh/sshd_config

 

sed -i -e "s/GSSAPIAuthentication yes/#GSSAPIAuthentication yes/g"  /etc/ssh/ssh_config

 

echo

ssh -V

 

date >> /etc/updatessh.conf

 

if [ "$2" = "restart" ]; then

/sbin/service sshd restart

fi

 

sshd -vesion

 

echo ""

echo "*************************"

echo "****************************"

echo "              All succeed!"

echo "*******************************"

echo "******************************"

感谢您对【51运维网 http://www.51ou.com/】的支持,我们为您免费提供《 升级openssh_6.7p1 ssl_1.0.1j》技术文章,《 升级openssh_6.7p1 ssl_1.0.1j》详细使用和说明,有时《 升级openssh_6.7p1 ssl_1.0.1j》可能不完善、敬请谅解!如果《 升级openssh_6.7p1 ssl_1.0.1j》有错误请给我们留言,我们将尽快修复文章错误,如果您觉得本站不错,请分享给周围的朋友!谢谢!

顶一下
(1)
100%
踩一下
(0)
0%
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
验证码:点击我更换图片