参草文档:
https://www.cnblogs.com/wholj/p/10944407.html
https://www.cnblogs.com/xiaochina/p/7486073.html
https://zhidao.baidu.com/question/1884039839022543348.html
**https://www.cnblogs.com/xiaochina/p/7485359.html**
查看相关版本信息:
openssl version -a
openssh -V
编译sshd------参考wanglei_centos7.0定制过程.txt
版本:openssh6.6p1
1.http://mirrors.evowise.com/pub/OpenBSD/OpenSSH/portable/
2.https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/
3../configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-pam(d) --with-md5-passwords \
--with-ssl-engine --with-tcp-wrappers=/usr/lib64/libwrap.so(d) --with-kerberos5=/usr/lib64/libkrb5.so \
--bindir=/usr/local/openssh/bin --sbindir=/usr/local/openssh/sbin
真实编译过程测试:
测试环境: centos7.6
1.获取openssh的版本:
https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/
2.编译:
./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh2 --with-ssl-dir=/usr/lib64/openssl/ --with-zlib
(ubuntu安装libssl-dev ; redhat安装openssl-devel 否则会报错)
yum install openssl-devel
3.安装:
make -j4 && make install
备份OpenSSH 旧配置文件#
mv /etc/init.d/sshd /etc/init.d/sshd.bak
4.修改ssh启动脚本
vim /root/openssh-7.4p1\contrib\redhat\sshd.init
sshd就是根据sshd,init修改的针对redhat发行版本
根据实际情况修正的sshd脚本 /etc/init.d/sshd
(没有的话:/root/openssh-7.4p1\contrib\redhat\sshd.init )
代码修改:
#!/bin/bash
#