- VIM /etc/ld.so.conf.d/local.conf #新建 local.conf 文件, 添加下面一行
- /usr/local/lib # 将 /usr/local/lib 目录加入到模块加载目录.
- ldconfig -v #重新加载共享模块:
- openssl version #查看版本
安装 openssh
- #--with-ssl-dir 指定 ssl 的安装目录
- #--with-zlib 指定 zlib 的安装目录
- ./configure --prefix=/usr/local/openssh-8.1p1 --sysconfdir=/etc/SSH --with-ssl-dir=/usr/local --with-zlib=/usr/local/zlib-1.2.11 --with-md5-passwords
- make
- make install
- cd /etc/init.d/
- mv sshd sshd.bak
- cd /usr/local/openssh-8.1p1/contrib/RedHat/
- cp -p sshd.init /etc/init.d/sshd
- vi /etc/init.d/sshd
- SSHD=/usr/local/openssh-8.1p1/sbin/sshd #25 行 SSHD=/usr/sbin/sshd
- /usr/local/openssh-8.1p1/bin/SSH-keygen -A #41 行 /usr/bin/SSH-keygen -A
- chkconfig --add sshd
- chkconfig sshd on
- chkconfig --list sshd
- service sshd restart
- VIM /etc/profile
- export PATH=/usr/local/openssh-8.1p1/bin:$PATH
CentOS7(RedHat7) 需要再做以下操作.
将 systemctl 下的原 SSH 相关文件移走, 将不然升级后的 openssh 不兼容.
- mv /usr/lib/systemd/system/SSH*/opt
- vi /etc/SSH/sshd_config // 增加下一行
- PermitRootLogin yes
- service sshd restart
vi /etc/profile 或者 ~/.bash_profile 设置 PATH 变量
- export PATH=/usr/local/openssh-8.1p1/sbin:/usr/local/openssh-8.1p1/bin:$PATH
- source /etc/profile
验证:
- SSH -V
- openssl version
来源: http://www.bubuko.com/infodetail-3319259.html