愿你出走半生,归来仍是少年

Kratos
专注于用户阅读体验的响应式博客主题
  1. 首页
  2. linux
  3. 正文

升级SSH服务-RedHat Linux

2016年8月29日 13358点热度 0人点赞 0条评论

一、◆◆首先配置telnet服务器
以便于远程操作、配置新版本的openssh。
◆在开始升级前要确认系统中安装了GCC 编译器
rpm -qa|grep gcc

二、◆◆升级Zlib
www.zlib.net
./configure --prefix=/usr/local/zlib
make
make install

三、◆◆升级openssl【注:此步骤已不再需要】
www.openssl.org
◆卸载已有的openssl
rpm -e `rpm -qa | grep openssl` --allmatches --nodeps
◆重新配置编译openssl到系统默认目录
./config --prefix=/usr --shared zlib
(安装openssl, 记得加--shared选项, 否则openssh编译的时候可能会找不到新安装的openssl的library, 会报错: openssl的 header和library版本不匹配)
(20151020:增加了zlib选项,可解决最后的错误提示“Zlib not supported: compression tests skipped”)
make clean(有时候这一步很关键)
make
make test(这一步是进行 SSL 加密协议的完整测试,如出现错误就要找出原因,否则可能导致 SSH 不能使用。)
make install
◆如果make时报错如下
c_zlib.c:25:18: 错误:zlib.h:没有那个文件或目录
原因是没有zlib的devel库,需要配置devel库。
◆确认openssl版本
openssl version -a

四、◆◆升级openssh
www.openssh.com
◆备份已有的ssh
mv /etc/ssh /etc/ssh.ljg
◆卸载ssh
rpm -e `rpm -qa|grep openssh` --allmatches --nodeps
◆编译ssh
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib=/usr/local/zlib --with-md5-passwords
make
make install
◆配置进系统服务
cp contrib/redhat/sshd.init /etc/init.d/sshd
chkconfig --add sshd
◆修改PAM配置
cp contrib/sshd.pam.generic /etc/pam.d/sshd
这里的lib需要修改为正确的路径,否则会在/var/log/secure里面看到无法找到lib的报错,导致pam无法生效!路径可参见su、rlogin等。
◆确认升级后的版本
ssh -V
◆由于默认没打开PAM支持,需修改/etc/ssh/sshd_config配置
UsePAM yes
PermitRootLogin yes

标签: ssh
最后更新:2016年8月29日

liking

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

归档

  • 2026 年 6 月
  • 2026 年 3 月
  • 2026 年 2 月
  • 2025 年 12 月
  • 2025 年 11 月
  • 2025 年 4 月
  • 2025 年 2 月
  • 2025 年 1 月
  • 2024 年 12 月
  • 2024 年 10 月
  • 2024 年 7 月
  • 2024 年 5 月
  • 2024 年 4 月
  • 2023 年 11 月
  • 2023 年 10 月
  • 2023 年 8 月
  • 2023 年 7 月
  • 2023 年 5 月
  • 2023 年 3 月
  • 2023 年 2 月
  • 2022 年 12 月
  • 2022 年 11 月
  • 2022 年 10 月
  • 2022 年 9 月
  • 2022 年 8 月
  • 2022 年 6 月
  • 2022 年 5 月
  • 2022 年 3 月
  • 2022 年 2 月
  • 2022 年 1 月
  • 2021 年 12 月
  • 2021 年 11 月
  • 2021 年 10 月
  • 2021 年 8 月
  • 2021 年 7 月
  • 2021 年 6 月
  • 2021 年 5 月
  • 2021 年 4 月
  • 2021 年 3 月
  • 2021 年 2 月
  • 2021 年 1 月
  • 2020 年 12 月
  • 2020 年 11 月
  • 2020 年 10 月
  • 2020 年 9 月
  • 2020 年 8 月
  • 2020 年 7 月
  • 2020 年 6 月
  • 2020 年 5 月
  • 2020 年 3 月
  • 2020 年 2 月
  • 2019 年 12 月
  • 2019 年 11 月
  • 2019 年 10 月
  • 2019 年 9 月
  • 2019 年 8 月
  • 2019 年 7 月
  • 2019 年 6 月
  • 2019 年 5 月
  • 2019 年 4 月
  • 2019 年 2 月
  • 2018 年 12 月
  • 2018 年 11 月
  • 2018 年 8 月
  • 2018 年 7 月
  • 2018 年 6 月
  • 2018 年 5 月
  • 2018 年 4 月
  • 2018 年 3 月
  • 2018 年 2 月
  • 2018 年 1 月
  • 2017 年 12 月
  • 2017 年 11 月
  • 2017 年 8 月
  • 2017 年 6 月
  • 2017 年 5 月
  • 2017 年 3 月
  • 2016 年 9 月
  • 2016 年 8 月
  • 2016 年 7 月
  • 2016 年 6 月
  • 2016 年 5 月
  • 2015 年 10 月
  • 2014 年 10 月
  • 2014 年 8 月
  • 2014 年 3 月
  • 2013 年 12 月
  • 2013 年 8 月
  • 2013 年 7 月
  • 2013 年 6 月
  • 2013 年 4 月
  • 2012 年 11 月
  • 2012 年 7 月
  • 2012 年 6 月
  • 2012 年 5 月
  • 2012 年 2 月
  • 2011 年 10 月
  • 2011 年 8 月
  • 2011 年 3 月
  • 2010 年 11 月
  • 2010 年 10 月
  • 2010 年 9 月
  • 2010 年 8 月
  • 2010 年 7 月
  • 2010 年 5 月
  • 2010 年 4 月
  • 2010 年 1 月
  • 2009 年 11 月
  • 2009 年 8 月
  • 2009 年 5 月
  • 2009 年 3 月
  • 2009 年 2 月
  • 2008 年 11 月
  • 2008 年 10 月
  • 2008 年 8 月
  • 2008 年 4 月
  • 2007 年 4 月

分类

  • BigData
  • kubernetes
  • linux
  • MongoDB
  • MySQL
  • Oracle
  • PostgreSQL
  • 备份恢复
  • 安装配置
  • 性能优化
  • 技术杂谈
  • 未分类
  • 梦回红楼
  • 测试
  • 生活点滴
  • 网站建设
  • 自制工具
  • 轻松一刻
  • 运维知识
  • 问题处理

COPYRIGHT © 2026 愿你出走半生,归来仍是少年. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang