CentOs 升级openSSH 7.8p 心酸之路

   本人纯linux小白,内网服务器被检测出漏洞需要升级openSSH 7.8p,自己网上一步步查询,断断续续搞了近两周干掉了四台虚拟机后终于成功了。

记录下心酸过程,因为是小白,会有好多白痴问题。

1、安装zlib
zlib-1.2.11.tar.gz
# tar xzvf zlib-1.2.11.tar.gz
#cd zlib-1.2.11
# ./configure --prefix=/usr/local/zlib
# make
# make install
这样,就把 zlib 编译安装在/usr/local/zlib 中了

2、安装rpm包
# rpm -ivh pam-devel-1.1.1-13.el6.x86_64.rpm
# rpm -ivh zlib-devel-1.2.7-18.el7.x86_64.rpm

3、openssl-fips-2.0.16.tar.gz
# tar -xzvf openssl-fips-2.0.16.tar.gz
# cd openssl-fips-2.0.16
# ./config
# make
# make install

4. 安装OpenSSL
# tar zxpf openssl-1.0.1h.tar.gz
# cd openssl-1.0.1h
# ./config fips --shared
# make && make install 

5. 将新编译的openssl library 加入系统动态库链接中
# echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
# ldconfig
update :如果在第4步openssl 编译过程中,将其设定为OS默认安装目录(--prefix=/usr),那么此步骤无需执行!

6.安装OpenSSH
# tar -xvf openssh-7.8p1.tar.gz
# cd openssh-7.8p1
#./configure --prefix=/opt/openssh7.8p1 --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-tcp-wrappers --with-ssl-dir=/usr/local/ --without-hardening
# make && make install
# echo 'export PATH=/opt/openssh7.8p1/bin:/opt/openssh7.8p1/sbin:$PATH' >> /etc/profile.d/path.sh
# . /etc/profile.d/path.sh


安装过程可能会遇到N种错误
1.
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    Permissions 0640 for '/etc/ssh/ssh_host_ecdsa_key' are too open.
    It is required that your private key files are NOT accessible by others.
    This private key will be ignored.
    Error loading host key "/etc/ssh/ssh_host_ecdsa_key": bad permissions
    Could not load host key: /etc/ssh/ssh_host_ecdsa_key
    
    这里是说密钥文件权限不能为0640,0640权限太开放了,要求你的密钥文件不能被其它用户读取。
    所以我们现在需要修改一下密钥文件权限。
    在命令行输入chmod 700 parkcloud-new.pem即可。
    这里“parkcloud-new.pem”就是warning里给出的密钥文件名,
    所以你需要换成你的warning信息里给出的秘钥文件名。
    chmod 700 /etc/ssh/ssh_host_ed25519_key
    格式如下:chmod 权限码 密钥文件名
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值