安装包地址
链接:https://pan.baidu.com/s/1lAtByN-mrpbp-ypwCVmPSQ
提取码:qwer
升级openssl
1.安装相关依赖
yum install gcc gcc-c++ glibc make autoconf openssl openssl-devel pcre-devel pam-devel -y
2.安装pam和zlib(可有可无)
yum install pam* zlib* -y
3.创建压缩包存放路径
mkdir -p /server/tools
4.安装 openssl
tar xf openssl-1.1.1k.tar.gz
5.备份
ll /usr/bin/openssl
ll /usr/include/openssl
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl /usr/include/openssl.bak
6.编译安装
cd openssl-1.1.1k
./config --prefix=/usr/local/ssl --shared
make && make install
7.查询执行结果,0表示没问题
echo $?
8.配置软连接
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/share/doc/openssl /usr/include/openssl
ln -s /usr/local/ssl/lib/libssl.so.1.1 /usr/lib64/libssl.so.1.1
ln -s /usr/local/ssl/lib/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1
ll /usr/bin/openssl
ll /usr/include/openssl
- 加载配置
echo "/usr/local/lib/" >> /etc/ld.so.conf
/sbin/ldconfig
openssl version
升级 opensshd
1.解压缩
cd /server/tools
tar xf openssh-8.5p1.tar.gz
chown -R root.root openssh-8.5p1
mv openssh-8.5p1 openssh
cd openssh
2.删除原ssh配置文件
rm -rf /etc/ssh/*
##修改版本,在编译前操作,不需要取消注释
vim version.h
#define SSH_VERSION "OpenSSH" ==== 将此处修改
#define SSH_PORTABLE "p12354" ===== 修改成自己想要的内容,也可以为空
#define SSH_RELEASE SSH_VERSION SSH_PORTABLE
3.编译安装
./configure --prefix=/usr/ --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/ssl --with-zlib --with-md5-passwords --with-pam
make && make install
4.校验
echo $?
- 修改配置文件
vim /etc/ssh/sshd_config
PermitRootLogin yes
UseDNS no
UseAPM yes
6.拷贝配置文件
mv /etc/init.d/sshd /etc/init.d/sshd.bak
cp -a contrib/redhat/sshd.init /etc/init.d/sshd
cp -a contrib/redhat/sshd.pam /etc/pam.d/sshd.pam
chmod +x /etc/init.d/sshd
- 移除原systemd管理的sshd文件,否则影响服务启动
mv /usr/lib/systemd/system/sshd.service /tmp/ #没用systemctl管理的可以省略这一步
8.设置sshd服务开机自启
chkconfig sshd on
9.测试服务启停
systemctl daemon-reload
systemctl restart sshd
netstat -lntup|grep ssh
10.查看版本已经变更
ssh -V
CentOS 7 更新 curl 为最新版本
- 更新 ca-bundle,首先备份一下:
cp /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.crt.bak
- 更新并替换:
curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt
- 新增 repo:
vim /etc/yum.repos.d/city-fan-for-curl.repo
内容为:
[CityFanforCurl]
name=City Fan Repo
baseurl=http://www.city-fan.org/ftp/contrib/yum-repo/rhel7/x86_64/
enabled=0
gpgcheck=0
- 更新 curl,直接使用如下命令进行更新:
yum update curl --enablerepo=CityFanforCurl -y
更新完成后,建议重启一下。就可以正常使用了。
5.查看版本:
#curl -V
curl 7.76.1 (x86_64-redhat-linux-gnu) libcurl/7.60.0 OpenSSL/1.0.2k zlib/1.2.7
Release-Date: 2021-04-14
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS HTTPS-proxy IPv6 Largefile libz Metalink NTLM NTLM_WB SSL UnixSockets
WARNING: curl and libcurl versions do not match. Functionality may be affected.