运维Linux系统,部署或升级openssh是经常面临的事,以下已redhat6和redhat7为例。

在redhat6中部署openssh会有什么坑,在编辑openssh源码包时会报一些类似的错误,如下:

checking OpenSSL header version... 10000003 (OpenSSL 1.0.0 29 Mar 2010)
     checking OpenSSL library version... configure: error: OpenSSL >= 1.0.1 required (have "10000003 (OpenSSL 1.0.0-fips 29 Mar 2010)")

  checking OpenSSL header version... not found
     configure: error: OpenSSL version header not found.

这是原因openssh在编辑时加上--without-hardening. 下面是写的一个shell安装openssh的过程. 在redhat7中没有这个问题.

openssh安装脚本

#!/bin/bash
# soft openssh install ftp -n <<EOF
open 10.204.202.67
user itom 1qaz)P(O
binary
cd soft
lcd /tmp
prompt
get openssh-.5p1.zip
close
bye
EOF # rpm -e ssh
ps -ef |grep sshd | grep -v grep
if [ $? -eq ];then
service sshd stop
fi LIST=`rpm -qa |grep openssh`
for i in $LIST
do
rpm -e $i --nodeps
if [ $? -eq ];then
echo "$i rpm delete ok"
else
echo "$i rpm delete warn"
fi
done
if [ -d /etc/ssh ];then
mv /etc/ssh /etc/ssh.bak
fi DIRSOFT='/tmp'
if [ -f $DIRSOFT/openssh-.5p1.zip ];then
unzip openssh-.5p1.zip
fi # install zlib
sleep
cd zlib-1.2.
./configure --prefix=/usr/local/zlib && make && make install
if [ $? -eq ];then
echo "soft zlib install ok!"
fi
sleep # install openssl
cd $DIRSOFT
tar -xzvf openssl-1.0.2l.tar.gz > /dev/null
sleep
cd openssl-1.0.2l
./config --prefix=/usr/local/openssl && make && make install
if [ $? -eq ];then
echo "soft openssl install ok!"
fi
sleep
echo "/usr/local/openssl/lib/" >> /etc/ld.so.conf
ldconfig # install openssh
cd $DIRSOFT
tar -xzvf openssh-.5p1.tar.gz > /dev/null
sleep
cd openssh-.5p1
./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/openssl
--with-zlib=/usr/local/zlib --with-md5-passwords --without-hardening && make && make install
if [ $? -eq ];then
echo "soft openssh install ok!"
fi
sleep cp contrib/redhat/sshd.init /etc/init.d/sshd
sed -i 's/SSHD=\/usr\/sbin\/sshd/SSHD=\/usr\/local\/openssh\/sbin\/sshd/g' /etc/init.d/sshd
sed -i 's/\/usr\/bin\/ssh-keygen -A/\/usr\/local\/openssh\/bin\/ssh-keygen -A/g' /etc/init.d/sshd chkconfig --add sshd
service sshd start
echo "export PATH=/usr/local/openssh/bin:$PATH" >> /etc/profile

Linux 部署或升级openssh7.5p1的更多相关文章

  1. openssh升级到openssh-7.5p1踩坑

    环境:ubuntu 需要的安装包: http://zlib.net/   zlib 1.2.11最新版 http://www.linux-pam.org/library/   pam 1.3.0 ht ...

  2. 关于Linux系统下基于Tomcat部署和升级war包的详细过程

    1.首先Linux先安装java,Tomcat 中间件规范要求: 1)         软件必须下载到/services/download_soft_v        --------(用xftp上传 ...

  3. Linux部署ASP.NET 5 (vNext)

    原文:Linux部署ASP.NET 5 (vNext) ASP.NET 5 (vNext) Linux部署   引言 工欲善其事,必先利其器. 首先,我们先明确下以下基本概念 Linux相关 Ubun ...

  4. Centos6升级至openssh-7.5p1

    最近公司有几台服务器需要搬至甲方(政府单位),所以在安装服务时用的是16年的openssh7.3pl, 今天通知我们有漏洞,需要再一次升级,看到官方文档上版本已升级至7.5,所以干脆直接搞7.5 具体 ...

  5. Nginx热部署 平滑升级 日志切割

    1.重载 修改nginx配置文件之后,在不影响服务的前提下想加载最新的配置,就可以重载配置即可. 操作如下: 1)修改nginx配置文件 2)nginx -t     检查nginx文件语法是否有误 ...

  6. centos6.4升级openssh7.4p1

    Centos6.4版本yum升级openssh版本最高到5.3,想要升级到更高的版本需要重新编译 一.查看当前openssh版本: [root@localhost ~]# ssh -VOpenSSH_ ...

  7. centos 6.5 升级openssh-7.5

    1.环境 2.安装telnet 服务,防止ssh升级之后登陆不上服务器,使用telnet 连接服务器 yum install telnet-server -y chkconfig telnet on ...

  8. ASP.NET Linux部署(2) - MS Owin + WebApi + Mono + Jexus

    ASP.NET Linux部署(2) - MS Owin + WebApi + Mono + Jexus 本文承接我的上一篇博文: ASP.NET 5 Linux部署,那篇文章主要是针对最新的ASP. ...

  9. Linux 部署ASP.NET SQLite 应用 的坎坷之旅 附demo及源码

    Linux 部署ASP.NET SQLite 应用 的坎坷之旅.文章底部 附示例代码. 有一台闲置的Linux VPS,尝试着部署一下.NET 程序,结果就踏上了坑之路,不过最后算是完美解决问题,遂记 ...

随机推荐

  1. WWDC2017-advanced_animations_with_uikit

    最后修改时间: 2017-12-1 官方视频链接 这个Session主要讲一下的几个内容: Basic(基础的): 动画工作原理 以及 动画如何计时 Interactive and Interrupt ...

  2. isinstance(object, classinfo) class type(name, bases, dict)

    w https://docs.python.org/3/library/functions.html#isinstance

  3. Ffmpeg AAC 编码错误 Input contains (near) NaN/+-Inf

    Ffmpeg AAC编码 如果传入参Frame的Sample Format 为 AV_SAMPLE_FMT_S16,会出现 错误提示 Input contains (near) NaN/+-Inf,需 ...

  4. SVN 客户端不显示图标解决方案

    下图为没有设置之前,文件夹不显示svn图标 SVN客户端不显示图标解决方案:右键svn->设置->图标覆盖->状态缓存选择"Windows外壳"->确定,刷 ...

  5. 阶段1 语言基础+高级_1-3-Java语言高级_06-File类与IO流_06 Properties集合_3_Properties集合中的方法load

    键值对文件,读取到集合中来使用 分隔符也可以用空格 读出来乱码

  6. tensorflow和keras的安装

    1 卸载tensorflow方法,在终端输入:  把protobuf删除了才能卸载干净. sudo pip uninstall protobuf sudo pip uninstall tensorfl ...

  7. Delphi 跨单元进入(访问)类的私有成员,protected ,private部分

    http://blog.sina.com.cn/s/blog_5f8861b60102v1nl.html Delphi 跨单元进入(访问)类的私有成员,protected ,private部分 (20 ...

  8. myeclipse 2015 myeclipse2010破解共存

    1.高版本选择bling版本,低版本选择profession版本2.用高版本的公钥替换低版本的公钥3.先破解低版本的后破解高版本的4.最后用高版本的替换低版本的文件

  9. 【ABAP系列】SAP LSMW(摘自官网)

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP LSMW(摘自官网)   前 ...

  10. C++笔记(5)——浮点数的比较

    判断是否相等 因为一个浮点数的存储并不总是精确的,例如在经过大量计算之后可能会将3.14保存为3.1400000000001或者3.1439999999999,这时候如果直接用==来比较这两个数的话会 ...