请选择
进入手机版
|
继续访问电脑版
首页
论坛
Portal
登录
立即注册
用户名
Email
自动登录
找回密码
密码
登录
立即注册
搜索
搜索
设为首页
收藏本站
开启辅助访问
切换到窄版
本版
文章
帖子
用户
道具
勋章
任务
门户
设置
切换到窄版
退出
腾讯QQ
微博登录
本文来自
安全运维工具
0
人已关注
请添加对本版块的简短描述
精选帖子
【腾讯云】中小企业福利专场,多款刚需产品
0阅读
|
493人阅读
【腾讯云】推广者专属福利,新客户无门槛领
0阅读
|
437人阅读
【腾讯云】境外1核2G服务器低至2折,半价续
0阅读
|
329人阅读
【腾讯云】云产品限时秒杀,爆款1核2G云服
0阅读
|
435人阅读
查看:
620
|
回复:
0
安全专题 - www.aqzt.com - 安全运维与开源架构技术交流社区!
»
论坛
›
安全专题
›
安全运维工具
›
查看内容
openssh 8.0 rpm 制作
[复制链接]
abc
当前离线
积分
6009
abc
620
0
abc
发表于 2019-11-18 19:16:43
|
显示全部楼层
|
阅读模式
yum install rpm-build zlib-devel openssl-devel gcc perl-devel pam-devel unzip -y
mkdir -p /root/rpmbuild/{SOURCES,SPECS}
cd /root/rpmbuild/SOURCES
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.0p1.tar.gz
wget https://src.fedoraproject.org/repo/pkgs/openssh/x11-ssh-askpass-1.2.4.1.tar.gz/8f2e41f3f7eaa8543a2440454637f3c3/x11-ssh-askpass-1.2.4.1.tar.gz
tar zxvf openssh-8.0p1.tar.gz openssh-8.0p1/contrib/redhat/openssh.spec
mv openssh-8.0p1/contrib/redhat/openssh.spec ../SPECS/
chown sshd:sshd /root/rpmbuild/SPECS/openssh.spec
cp /root/rpmbuild/SPECS/openssh.spec /root/rpmbuild/SPECS/openssh.spec_def
sed -i -e "s/%define no_gnome_askpass 0/%define no_gnome_askpass 1/g" /root/rpmbuild/SPECS/openssh.spec
sed -i -e "s/%define no_x11_askpass 0/%define no_x11_askpass 1/g" /root/rpmbuild/SPECS/openssh.spec
vim openssh.spec
注释掉 BuildRequires: openssl-devel < 1.1 因为目前安装的版本都低于1.1
cd /root/rpmbuild/SPECS/
rpmbuild -ba openssh.spec
cp /etc/pam.d/sshd /etc/pam.d/sshd.old
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.old
cat /etc/pam.d/sshd.old > /etc/pam.d/sshd
cat /etc/ssh/sshd_config.old > /etc/ssh/sshd_config
rpm -Uvh *.rpm
rm -rf /etc/ssh/ssh_host_*key
/etc/init.d/sshd restart >/dev/null 2>&1
安装注意:
########################################
Vi修改/etc/ssh/sshd_config文件,修改如下内容:
#PermitRootLogin prohibit-password 修改为PermitRootLogin yes
#UsePAM no 修改为 UsePAM yes
/etc/pam.d/sshd 要覆盖原来的文件 不然密码验证不通过
https://www.openssl.org/source/
复制代码
安装脚本
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
##########################################################
## ##
## Script Name:install-openssh for Redhat-CenOS-6.0~7.6 ##
## By:Eren 2019-08-29 ##
## ##
##########################################################
###
echo ---- config file copy ......Please Wait ----
cp /etc/pam.d/sshd /tmp/
cp /etc/ssh/sshd_config /tmp/
if [ $? == 1 ]
then
echo "cp failed "
exit 0
fi
###
echo ---- install-openssh ......Please Wait ----
###
os=`cat /etc/redhat-release|sed -r 's/.* ([0-9]+)\..*/\1/'`
if [ $os == 6 ];then
rpm -Uvh *el6*.rpm
else
rpm -Uvh *el7*.rpm
fi
echo ---- install-openssh installation is Complete ----
###
cat /tmp/sshd > /etc/pam.d/sshd
cat /tmp/sshd_config > /etc/ssh/sshd_config
###
#sed -i '/#UsePAM no/a\UsePAM yes' /etc/ssh/sshd_config
###
rm -rf /etc/ssh/ssh_host_*key
/etc/init.d/sshd restart >/dev/null 2>&1
###
ssh -V
复制代码
https://www.cnblogs.com/liweiming/p/11571841.html
回复
使用道具
举报
返回列表
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
立即注册
本版积分规则
发表回复
回帖后跳转到最后一页
快速回复
返回顶部
返回列表