centOS Linux升级openssh8.3.p1,openssl1.1.1g

1.检查JCC环境

 

root@credit_elsearch zlib-1.2.8]# gcc -v
bash: gcc: command not found...

存在缺失GCC环境需要安装GCC

yum -y install gcc gcc-c++ kernel-devel //安装gcc、c++编译器以及内核文件

如果安装报

[Errno 14] HTTP Error 404 - Not Found 错误的解决方法

yum clean all

rpm --rebuilddb

 

2.下载openssh8.3升级包及依赖的zlib和openssl。

openssh-8.3p1.tar.gz、zlib-1.2.11.tar.gz、openssl-1.1.1g.tar.gz

百度搜索名称,官网可以下载

下载后将文件放到use/src 下面

 

3.解压升级包

 

tar --no-same-owner -zxvf zlib-1.2.11.tar.gz
tar --no-same-owner -zxvf openssh-8.3p1.tar.gz
tar --no-same-owner -zxvf openssl-1.1.1g.tar.gz

4.编译安装zlib

cd zlib-1.2.11
./configure --prefix=/usr/local/zlib
make && make install

 

5.编译安装openssl

cd openssl-1.1.1g

./config --prefix=/usr/local/ssl -d shared

make && make install

#删除原来的配置文件
rm -rf /usr/bin/openssl 
rm -rf /usr/lib64/openssl 
rm -rf /usr/lib64/libssl.so 

#配置文件的软链接
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
ln -s /usr/local/ssl/lib/libssl.so /usr/lib64/libssl.so 

#修改配置文件
echo '/usr/local/ssl/lib' >> /etc/ld.so.conf

#配置动态链接库
ldconfig -v 

#查看openssl版本
openssl version 

 6.安装openssh

cd openssh-8.3p1
./configure --prefix=/usr/local/openssh --with-zlib=/usr/local/zlib --with-ssl-dir=/usr/local/ssl
make && make install

#sshd_config文件修改
echo 'PermitRootLogin yes' >>/usr/local/openssh/etc/sshd_config
echo 'PubkeyAuthentication yes' >>/usr/local/openssh/etc/sshd_config
echo 'PasswordAuthentication yes' >>/usr/local/openssh/etc/sshd_config

#备份原有文件,并将新的配置复制到指定目录
mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
cp /usr/local/openssh/etc/sshd_config /etc/ssh/sshd_config

mv /usr/sbin/sshd /usr/sbin/sshd.bak
cp /usr/local/openssh/sbin/sshd /usr/sbin/sshd

mv /usr/bin/ssh /usr/bin/ssh.bak
cp /usr/local/openssh/bin/ssh /usr/bin/ssh

mv /usr/bin/ssh-keygen /usr/bin/ssh-keygen.bak
cp /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygen

mv /etc/ssh/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub.bak
cp /usr/local/openssh/etc/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub

#启动sshd
service sshd restart

#查看信息版本
ssh -V

 

 

另外升级后secureCRT

exchange failed.
No compatible key-exchange method. The server supports these methods: curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256

 出现这种错误,删除之前连接配置,重新创建。有些密钥协议变了,SecureCRT中的密钥保存的旧版本已经不支持了,创建一个新的连接就可以了。如果还是不行升级Secure版本再试

 

 

 

你可能感兴趣的:(Linux,linux,ssh,centos)