限制SSH访问源,禁止4A之外的地址跳转访问
【fuel节点】
在/etc/hosts.allow文件中
添加:
sshd:10.129.0.1:allow
sshd:10.129.0.2:allow
sshd:10.129.0.3:allow
sshd:10.129.3.1:allow
sshd:10.129.3.2:allow
sshd:10.129.3.3:allow
在/etc/hosts.deny文件中
添加:
sshd:ALL
最后sshd重启
service sshd restart
【control节点】
在/etc/hosts.allow文件中
添加:
sshd:10.129.0.1:allow
sshd:10.129.0.2:allow
sshd:10.129.0.3:allow
sshd:10.129.3.1:allow
sshd:10.129.3.2:allow
sshd:10.129.3.3:allow
sshd:10.254.1.1:allow
在/etc/hosts.deny文件中
添加:
sshd:ALL
最后sshd重启
service sshd restart
【compute节点】
在/etc/hosts.allow文件中
添加:
sshd:10.129.0.1:allow
sshd:10.129.0.2:allow
sshd:10.129.0.3:allow
sshd:10.129.3.1:allow
sshd:10.129.3.2:allow
sshd:10.129.3.3:allow
sshd:10.254.1.1:allow
sshd:10.254.1.15:allow
sshd:10.254.1.30:allow
sshd:10.254.1.45:allow
在/etc/hosts.deny文件中
添加:
sshd:ALL
最后sshd重启
service sshd restart
其中,计算节点可用如下脚本:
#! /bin/bash
line=`grep ^10 ~/hosts|wc -l`
for i in `seq $line`
do
des=`grep ^10 hosts|sed -n ${i}p`
ssh $des ' echo 'sshd:10.129.0.1:allow' >> /etc/hosts.allow'
ssh $des ' echo 'sshd:10.129.0.2:allow' >> /etc/hosts.allow'
ssh $des ' echo 'sshd:10.129.0.3:allow' >> /etc/hosts.allow'
ssh $des ' echo 'sshd:10.129.3.1:allow' >> /etc/hosts.allow'
ssh $des ' echo 'sshd:10.129.3.2:allow' >> /etc/hosts.allow'
ssh $des ' echo 'sshd:10.129.3.3:allow' >> /etc/hosts.allow'
ssh $des ' echo 'sshd:10.254.1.1:allow' >> /etc/hosts.allow'
ssh $des ' echo 'sshd:10.254.1.15:allow' >> /etc/hosts.allow'
ssh $des ' echo 'sshd:10.254.1.30:allow' >> /etc/hosts.allow'
ssh $des ' echo 'sshd:10.254.1.45:allow' >> /etc/hosts.allow'
ssh $des ' echo 'sshd:ALL' >> /etc/hosts.deny'
ssh $des ' service sshd restart '
echo $des >> ip.log
done
if [ $i == $line ];then
echo 'deploy success'
else
echo 'deploy failed'
fi
限制SSH访问源,禁止4A之外的地址跳转访问的更多相关文章
- tomcat 禁止某些文件(夹)的访问
tomcat 禁止某些文件(夹)的访问 <!-- 不允许访问的文件以及文件夹 --> <security-constraint> <display-name>Tom ...
- [置顶] 如何访问web文件夹之外的文件
在编写项目时,遇到一个如何访问web文件夹之外的文件的问题.因为我要制作一个浏览图片和pdf文件的一个简单网站.但问题是图片的文件夹和pdf文件的文件夹都是其他程序生成的,自然也就是不是网站w ...
- nginx禁止ip登录,只允许域名访问
公司要求,线上solr.kibana要求只能通过域名进行访问,禁止用ip+端口进行登录访问,那么,下面介绍下我是如何实现的 1.禁止ip,允许域名访问 如下图,默认安装好nginx,不让ip方式访问, ...
- php如何控制用户对图片的访问 PHP禁止图片盗链
本文摘自网络仅供学习只用 本人根据教程总结了一下https://www.imooc.com/video/13412 主要是利用apache的htacess进行控制,,拿什么判断是不是通过本站点访问的呢 ...
- Nginx禁止直接通过IP地址访问网站以及限制IP登陆某目录(关闭默认站点或空主机头)
这篇文章主要介绍了Nginx中禁止使用IP访问网站的配置实例,一般在备案时可能需要这种设置,需要的朋友可以参考下 国内因为备案的原因,所有服务器都要禁止使用IP访问网站.否则,如果允许使用IP访问 ...
- Nginx禁止直接通过IP地址访问网站
介绍下在nginx服务器禁止直接通过IP地址访问网站的方法,以避免别人恶意指向自己的IP,有需要的朋友参考下. 有时会遇到很多的恶意IP攻击,在Nginx下可以禁止IP访问. Nginx的默认虚拟主机 ...
- EC2 开启 IPV6 访问 和 禁止重启后自动分配IP地址
EC2 开启 IPV6 访问 和 禁止重启后自动分配IP地址进入 VPC 控制台,对当前 VPC 添加 IPV6 CIDR 块对该 VPC 的路由表进行修改,添加其它路由,第一个空填::/0,第二个空 ...
- eclipse svn 以一种访问权限不允许的方式做了一个访问套接字的尝试
以一种访问权限不允许的方式做了一个访问套接字的尝试 svn: Unable to connect http://xxx.xxx 安装插件是把Eclipse的网络访问禁止了,然后用svn就老提示[以一种 ...
- server2003中看不到网上邻居内容,其他电脑无法通过计算机名和IP访问本计算机(但网上邻居中可访问到)
现象1:server2003中看不到网上邻居内容,查看工作组计算机看到的是空列表, 现象2:其他电脑无法通过计算机名和IP访问本计算机(但网上邻居中可访问到) 访问提示:--Windows 200 ...
随机推荐
- Swift学习笔记二
Swift是苹果公司开发的一门新语言,它当然具备面向对象的许多特性,现在开始介绍Swift中类和对象的语法. 对象和类 用"class"加上类名字来创建一个类,属性声明和声明常量或 ...
- Codeforces gym 100685 C. Cinderella 水题
C. CinderellaTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100685/problem/C ...
- Codeforces Gym 100286B Blind Walk DFS
Problem B. Blind WalkTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/cont ...
- swift开发:试玩 Apple 站点的 playground
https://developer.apple.com/library/prerelease/ios/documentation/swift/conceptual/swift_programming_ ...
- A beginner’s guide to Cache synchronization strategies--转载
原文地址:http://vladmihalcea.com/2015/04/20/a-beginners-guide-to-cache-synchronization-strategies/ Intro ...
- Tick and Tick
The three hands of the clock are rotating every second and meeting each other many times everyday. F ...
- jQuery Validate 插件[表单验证]
在客户端添加信息提交表单时我们经常需要做一些验证,比如验证不能为空,验证客户输入手机格式,验证客户输入email,url等的格式,我们可以通过EL表达式结合js 进行自主验证,今天总结一个JQuery ...
- 想学React Native?你只需要一个App!(11月5号更新)
最近有点空闲时间,顺手研究下react-native,2013年的时候在老师的指导下使用jQuery Mobile做过手机应用,那个运行速度慢呀!让我对WebApp和PhoneGap这一类的跨平台Ap ...
- 开发一个struts2的实例
前面一篇博客(实现struts2框架)带大家对基于mvc业务流程熟悉了一下,现在我们就用对mvc实现最好的框架struts2来开发一个应用实例.虽然现在MyEclipse8.5以上版本已经开始支持St ...
- [改善Java代码]适时选择getDeclaredxxx和getxxx
Java的Class类提供了很多的getDeclaredxxx方法和getxxx方法,例如getDeclaredmethod和getMethod成对出现,getDeclaredConstructors ...