暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

磐维数据库openSSH 8.0到openSSH 9.3

原创 #5z# ๑҉ 2024-01-08
1023

磐维数据库,简称"PanWeiDB"。是中国移动信息技术中心首个基于中国本土开源数据库打造的面向ICT基础设施的自研数据库产品。其产品内核能力基于华为openGauss开源软件,并进一步提升了系统稳定性。

适用范围

PanWeiDB 1.0.0、PanWeiDB 2.0.0

问题概述

PanWeiDB 在BC linux 8.2安装之后,omm用户使用ssh会报错:

$ ssh node2
ssh: symbol lookup error: /usr/lib64/libk5crypto.so.3: undefined symbol: EVP_KDF_ctrl, version OPENSSL_1_1_1b

该问题是由于omm用户使用LD_LIBRARY_PATH配置动态库路径时,优先使用了数据库lib下,版本不匹配,引起错误。

临时解决方式:修改omm用户的.bashrc文件,将路径/lib64放到LD_LIBRARY_PATH环境变量的最前面即可使用ssh命令,不过此时数据库工具如gsql将不能正常使用。

彻底解决方式是升级openSSH版本到9.3

升级openSSH

1.安装编译所需依赖软件包:

yum install wget gcc pam-devel libselinux-devel zlib-devel openssl-devel

2.下载OpenSSH安装包上传至服务器或wget直接下载

cd /usr/local/src
wget -O openssh.tar.gz http://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.3p1.tar.gz

3.备份配置文件

cp /etc/ssh/sshd_config sshd_config.backup
cp /etc/pam.d/sshd sshd.backup

4.删除低版本OpenSSH包

rpm -e --nodeps `rpm -qa | grep openssh`

5.安装openssh

解压包

tar -zxvf openssh.tar.gz
cd openssh-9.3p1

编译配置

./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-pam --with-zlib --with-tcp-wrappers --with-ssl-dir=/usr/local/ssl --without-hardening

make编译

make && make install

可能会出现如下错误

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0640 for '/etc/ssh/ssh_host_rsa_key' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         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.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0640 for '/etc/ssh/ssh_host_ed25519_key' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
sshd: no hostkeys available -- exiting.
make: [Makefile:385: check-config] Error 1 (ignored)

调整文件权限如下:

chmod 600 /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_ed25519_key

再次make install即可成功。

6.复制配置文件并配置权限

cp -a contrib/redhat/sshd.init /etc/init.d/sshd
chmod u+x /etc/init.d/sshd

7.还原配置文件

mv sshd.backup /etc/pam.d/sshd
mv sshd_config.backup /etc/ssh/sshd_config

8.添加自启服务ssh到开机启动项

chkconfig --add sshd
chkconfig sshd on

9.重启服务

systemctl restart sshd

验证结果

$ ssh -V
OpenSSH_9.3p1, OpenSSL 1.1.1k  25 Mar 2021

升级完成,重启虚拟机,验证能否正常登录。

最后可以清理源代码

rm -rf /usr/local/src/openssh*
最后修改时间:2024-01-22 19:01:13
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论