基于源码编译openssh+基于源码编译openssl经历参考

参草文档:

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
#
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值