本人不见一采用这种方法安装,只是当遇到问题时候有一定的参考意义,所以贴了上来。建议使用yum方式安装,详见在下另一篇博文:

http://blog.csdn.net/lqzixi/article/details/24816735http://blog.csdn.net/lqzixi/article/details/24816735

linux下升级openssh
 
查询是否安装telnet 
#  rpm -qa | grep telnet 
telnet-server-0.17-31.EL4.5 
telnet-0.17-31.EL4.5 
 
打开telnet服务 
修改设置文件/etc/xinetd.d/telnet中disable字段改为no。 
启动服务#ntsysv或#service xinetd restart。 
创建登陆用户 
因为不能直接root telnet登陆,所以创建一个登陆用户.安转完成后可以把该用户删除 
useradd opensshinstall 
(删除用户及/home/sshinstall目录  userdel -r sshinstall   删除这个用户的组groupdel sshinstall) 
 
安装源文件在/usr/local/src目录下 
zlib和openssl安装在/usr/local目录下 
 
安装zlib-1.2.5 
#tar -zxvf zlib-1.2.5.tar.gz 
#cd zlib-1.2.5 
#./configure --prefix=/usr/local/zlib-1.2.5 -share 
#make 
#make test 
#make install 
cp libz.a /usr/local/zlib-1.2.5/lib 
cp libz.so.1.2.5 /usr/local/zlib-1.2.5/lib 
cd /usr/local/zlib-1.2.5/lib; chmod u=rw,go=r libz.a 
cp zlib.3 /usr/local/zlib-1.2.5/share/man/man3 
chmod 644 /usr/local/zlib-1.2.5/share/man/man3/zlib.3 
cp zlib.pc /usr/local/zlib-1.2.5/lib/pkgconfig 
chmod 644 /usr/local/zlib-1.2.5/lib/pkgconfig/zlib.pc 
cp zlib.h zconf.h /usr/local/zlib-1.2.5/include 
chmod 644 /usr/local/zlib-1.2.5/include/zlib.h /usr/local/zlib-1.2.5/include/zconf.h 
#vi /etc/ld.so.conf    配置库文件搜索路径 
include ld.so.conf.d/*.conf 
##add 2010.7.7 
/usr/local/zlib-1.2.5/lib 
##add end 
#ldconfig -v       刷新缓存文件/etc/ld.so.cache 
#ln -s /usr/local/zlib-1.2.5 /usr/local/zlib 
 
 
安装openssl 
#cd /usr/local/src 
#tar zxvf openssl-1.0.0a.tar.gz 
#cd openssl-1.0.0a 
#./config shared zlib-dynamic --prefix=/usr/local/openssl-1.0.0a --with-zlib-lib=/usr/local/zlib-1.2.5/lib --with-zlib-include=/usr/local/zlib-1.2.5/include 
#make 
#make test (这一步是进行 SSL 加密协议的完整测试,如果出现错误就要一定先找出原因,否则一味继续可能导致 SSH 不能使用!) 
#make install 
#vi /etc/ld.so.conf      配置库文件搜索路径 
############################################ 
## add below line to ld.so.conf 
/usr/local/openssl-1.0.0a/lib                    64位OS 没有生成lib目录,是lib64目录 
############################################ 
#ldconfig -v       刷新缓存文件/etc/ld.so.cache 
#ln -s /usr/local/openssl-1.0.0a /usr/local/openssl 
vi /etc/profile 
########################################### 
(add to end of the file) 
PATH=/usr/local/openssl/bin:$PATH 
export PATH 
########################################### 
 
退出,再登录,查看openssl的版本号,以验正是否安装正确 
#openssl version -a 
OpenSSL 1.0.0a 1 Jun 2010 
built on: Wed Jul  7 17:08:07 CST 2010 
platform. linux-x86_64 
options:  bn(64,64) rc4(1x,char) des(idx,cisc,16,int) idea(int) blowfish(idx) 
compiler: gcc -fPIC -DOPENSSL_PIC -DZLIB_SHARED -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DWHIRLPOOL_ASM 
OPENSSLDIR: "/usr/local/openssl-1.0.0a/ssl" 
 
 
 
停止并卸载Openssh 
1.停止OpenSSH服务 
#service sshd stop 
2. 查询并卸载openssh 
# rpm -qa | grep openssh 
openssh-3.9p1-8.RHEL4.24 
openssh-askpass-3.9p1-8.RHEL4.24 
openssh-clients-3.9p1-8.RHEL4.24 
openssh-server-3.9p1-8.RHEL4.24 
openssh-askpass-gnome-3.9p1-8.RHEL4.24 
#rpm -e openssh-3.9p1-8.RHEL4.24 --nodeps 
#rpm -e openssh-clients-3.9p1-8.RHEL4.24 --nodeps 
警告/etc/ssh/ssh_config 已存为 /etc/ssh/ssh_config.rpmsave 
#rpm -e openssh-askpass-3.9p1-8.RHEL4.24 
#rpm -e openssh-server-3.9p1-8.RHEL4.24  --nodeps 
#rpm -e openssh-askpass-gnome-3.9p1-8.RHEL4.24 
cd /usr/local/src 
tar zxvf openssh-5.5p1.tar.gz 
cd  openssh-5.5p1 
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-ssl-dir=/usr/local/openssl-1.0.0a --with-md5-passwords --mandir=/usr/share/man --with-zlib=/usr/local/zlib-1.2.5 
#make 
#make install 
将sshd加入启动服务: 
进入ssh安装解压目录 
#cp ./contrib/redhat/sshd.init /etc/init.d/sshd 
#chmod +x /etc/init.d/sshd 
#chkconfig --add sshd 
最后,启动 SSH 服务使修改生效: 
# service sshd start 
重启后确认一下当前的 OpenSSH 和 OpenSSL 是否正确: 
# ssh -v 
如果看到了新的版本号就没问题啦! 
关闭telnet服务 
修改设置文件/etc/xinetd.d/telnet中disable字段改为yes。 
启动服务#ntsysv或#service xinetd restart。 
注意问题 
1.在安装openssh, ./configure 时,报下面错误: 
configure: error: PAM headers not found 
运行# rpm -qa | grep pam 
   pam_smb-1.1.7-5 
   pam_ccreds-1-3 
   pam_passwdqc-0.7.5-2 
   pam-0.77-66.17 
   pam_krb5-2.1.8-1 
   spamassassin-3.0.6-1.el4 
发现有 pam-0.77-66.17,从网上找到 pam-devel-0.77-66.17.i386.rpm, 
运行rpm -ivh pam-devel-0.77-66.17.i386.rpm后,./configure正常 
版本号0.77-66.17必须一样。 
2.在安装openssh时,configure报错: 
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib --with-ssl-dir=/usr/include/openssl --with-md5-passwords --mandir=/usr/share/man 
..... 
configure: error: *** zlib too old - check config.log *** 
Your reported zlib version has known security problems.  It's possible your 
vendor has fixed these problems without changing the version number.  If you 
are sure this is the case, you can disable the check by running 
"./configure --without-zlib-version-check". 
If you are in doubt, upgrade zlib to version 1.2.3 or greater. 
See http://www.gzip.org/zlib/ for details. 
因此需要升级zlib. 
3.如果操作系统是64位的,openssl-1.0.0a只生成了lib64,没有生成lib目录。openssh configure时,还是连接的老版本的openssl,郁闷。 
4. ./configure显示信息: 
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-ssl-dir=/usr/local/openssl-1.0.0a --with-md5-passwords --mandir=/usr/share/man --with-zlib=/usr/local/zlib-1.2.5 
显示信息: 
OpenSSH has been configured with the following options: 
                     User binaries: /usr/bin 
                   System binaries: /usr/sbin 
               Configuration files: /etc/ssh 
                   Askpass program: /usr/libexec/ssh-askpass 
                      Manual pages: /usr/share/man/manX 
                          PID file: /var/run 
  Privilege separation chroot path: /var/empty 
            sshd default user PATH: /usr/bin:/bin:/usr/sbin:/sbin 
                    Manpage format: doc 
                       PAM support: yes 
                   OSF SIA support: no 
                 KerberosV support: no 
                   SELinux support: no 
                 Smartcard support: 
                     S/KEY support: no 
              TCP Wrappers support: no 
              MD5 password support: yes 
                   libedit support: no 
  Solaris process contract support: no 
       IP address in $DISPLAY hack: no 
           Translate v4 in v6 hack: yes 
                  BSD Auth support: no 
              Random number source: OpenSSL internal ONLY 
              Host: i686-pc-linux-gnu 
          Compiler: gcc 
    Compiler flags: -g -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -fno-builtin-memset -std=gnu99 
Preprocessor flags: -I/usr/local/openssl-1.0.0a/include -I/usr/local/zlib-1.2.5/include 
      Linker flags: -L/usr/local/openssl-1.0.0a/lib -L/usr/local/zlib-1.2.5/lib 
         Libraries: -lresolv -lcrypto -ldl -lutil -lz -lnsl  -lcrypt 
         +for sshd:  -lpam 
PAM is enabled. You may need to install a PAM control file 
for sshd, otherwise password authentication may fail. 
Example PAM control files can be found in the contrib/ 
subdirectory 
 

linux下升级openssh参考[不建议采用此法安装]的更多相关文章

  1. Linux下的暴力密码在线破解工具Hydra安装及其组件安装-使用

    Linux下的暴力密码在线破解工具Hydra安装及其组件安装-使用 hydra可以破解: http://www.thc.org/thc-hydra,可支持AFP, Cisco AAA, Cisco a ...

  2. linux下怎么卸载自带的JDK和安装想要的JDK

    linux下怎么卸载自带的JDK和安装想要的JDK   安装linux系统后,系统有自带jdk的版本,因为系统中的有些软件需要使用此环境.但时候我们安装eclipse和tomcat的时候,使用此jdk ...

  3. CentOS 7 下升级OpenSSH 7.4p1到OpenSSH 8.4p1

    文章目录 一.环境介绍 二.安装配置telnet 2.1.安装telnet-server 2.2.配置telnet 2.3.配置telnet登录的终端类型 2.4.启动telnet服务 三.切换登录方 ...

  4. 【转载】linux下升级npm以及node

    原文:http://blog.csdn.net/qq_16339527/article/details/73008708 npm升级 废话不多说,直接讲步骤.先从容易的开始,升级npm. npm这款包 ...

  5. Linux下升级Python到3.5.2版本

    原文出处:https://www.cnblogs.com/tssc/p/7762998.html 本文主要介绍在Linux(CentOS)下将Python的版本升级为3.5.2的方法 众所周知,在20 ...

  6. Linux 下升级python和安装pip

    Linux版本升级: 1.  首先确认Linux操作系统中自带的python 版本时候与自己所需要的版本一致 所有的python版本都在https://www.python.org/ftp/pytho ...

  7. linux下升级npm以及node

    npm升级 废话不多说,直接讲步骤.先从容易的开始,升级npm. npm这款包管理工具虽然一直被人们诟病,很多人都推荐使用yarn,但其使用人数还是不见减少,况且npm都是随node同时安装好的,一时 ...

  8. Linux下升级安装Python-3.6.2版本

    本文主要介绍在Linux(CentOS)下将Python的版本升级为3.6.2的方法 众所周知,在2020年python官方将不再支持2.7版本的python,所以使用3.x版本的python是必要的 ...

  9. linux下一个C语言要求CPU采用

    部分   从灾难中 本来我想写一个小程序来测试CPU其他工具利用它可以检验类数据的性能.以后参考IPbench中间cpu_target_lukem插件实现我们的功能.原理非常简单:就是我们给程序设置了 ...

  10. Linux下升级openssl

    公司由于使用第三方漏洞扫描,检测出openssh存在漏洞,升级openssh后仍无效果,于是升级openssl 系统信息: 依赖软件:make.gcc.zlib1g-dev 升级步骤: 1.去官网下载 ...

随机推荐

  1. 词根 ten 展开 持有 /tin/tent/tain “to hold”

    词根 ten 展开 持有 /tin/tent/tain "to hold" 记忆方式:en是拿出.忘了从哪里看的了.t是动作过去. 如果是 过去的时候已经拿出来,那就是 展开 延展 ...

  2. vue 可选链 功能 ?. 替代 res && res.status 可以变成 res?.status

    安装 cnpm install --save-dev @babel/plugin-proposal-optional-chaining .babelrc { "presets": ...

  3. 【算法】C和Python实现快速排序-三数中值划分选择主元(非随机)

    一.快排基础 1.1 快排的流程 将数组A进行快速排序的基本步骤-quick_sort(A): 递归基础情况:如果A中的元素个数是1或0,则返回. 选取主元:取A中的任意一个元素v,作为主元(pivo ...

  4. SQL注入的原理与分析

    SQL注入的原理与分析 1.SQL注入的本质 2.部分SQL语句 3.SQL注入流程 一.SQL注入的本质 SQL注入的本质,就是把用户输入的数据当作代码执行 Web应用程序对用户输入的数据校验处理不 ...

  5. java的内存模型认识

    参考,欢迎点击原文:https://www.bilibili.com/video/BV1CW411U726(B站) https://www.bilibili.com/video/BV12t411u72 ...

  6. 算法研究之快速排序java版

    很早之前就已经接触过快速排序算法了,面试当中也屡屡被问到,虽然明白其原理,但从未真正的用代码敲出来. 写关于算法的代码之前一定要原理想明白,不然就是盲目,在参考有关资料及自己的沉思之后,写出如下代码, ...

  7. 12_采样格式&音频重采样

    采样格式 通过前面学习我们知道FFmpeg和SDL都有自己的采样格式的表达式,那么他们都表示什么意思呢? FFmpeg的采样格式的表达式: enum AVCodecID { ...... AV_COD ...

  8. C++ 构造函数 explicit 关键字 成员初始化列表

    通常,构造函数具有public可访问性,但也可以将构造函数声明为 protected 或 private.构造函数可以选择采用成员初始化表达式列表,该列表会在构造函数主体运行之前初始化类成员.与在构造 ...

  9. 01.Android崩溃Crash封装库

    目录介绍 01.该库具有的功能 02.该库优势分析 03.该库如何使用 04.降低非必要crash 05.异常恢复原理 06.后续的需求说明 07.异常栈轨迹原理 08.部分问题反馈 09.其他内容说 ...

  10. 设计模式之二:Builder模式

    设计模式之二:Builder模式 目录介绍 0.关于Builder模式案例下载 1.Builder模式介绍 2.Builder模式使用场景 3.Builder模式简单案例 3.1 Builder模式U ...