vi etc/iptable/sysconfig/iptables
linux 开放固定端口
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1113 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 55151 -j ACCEPT
重启防火墙:service iptables restart
关闭防火墙:service iptables stop
开启防火墙:service iptables start
保存 service iptables save
CentOS 6.5开放端口方法
1、LINUX下通过命令开启允许对外访问的网络端口:
/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT #开启8080端口
/etc/rc.d/init.d/iptables save #保存配置
/etc/rc.d/init.d/iptables restart #重启服务
2、查看端口是否开放
/etc/init.d/iptables status
禁用指定ip连接服务器
iptables -A INPUT -i eth0 -s "111.111.111.111" -j DROP
centos 7 使用firewalld 代替了 centos 6中的iptables 防火墙 所以配置方式有所改变
firewall-cmd --zone=public --add-port=80/tcp --permanent 开放80端口
参数详情:
--zone #作用域
--add-port=80/tcp #添加端口,格式为:端口/通讯协议
--permanent #永久生效,没有此参数重启后失效
重启防火墙
firewall-cmd --reload
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
立即生效 关闭selinux 重启后失效
setenforce 0
安装iptables
yum install iptables iptables-services
systemctl stop firewalld //停止firewalld
systemctl mask firewalld // 禁用firewalld
systemctl enable iptables //启用iptables
systemctl start iptables //开启iptables
禁止用户直接通过root登录
vim /etc/ssh/sshd_config
修改:PermitRootLogin yes
重启sshd服务:systemctl restart sshd.service
Linux 防火墙开放特定端口 (iptables)
iptables是linux下的防火墙,同时也是服务名称. service iptables status 查看防火墙状态 service iptables start ...
Linux 防火墙开放特定端口 (iptables)
1.查看状态:iptables -L -n2.直接编辑:vi /etc/sysconfig/iptables3.端口开放:-A INPUT -m state --state NEW -m tcp -p ...
CentOS 防火墙开放特定端口
iptables是linux下的防火墙,同时也是服务名称. service iptables status 查看防火墙状态 service iptables start ...
Win10如何设置防火墙开放特定端口 windows10防火墙设置对特定端口开放的方法
Win10防火墙虽然能够很好地保护我们的系统,但同时也会因限制了某些端口,而给我们的操作带了一些不便.对于既想使用某些端口,又不愿关闭防火墙的用户而言,在Win10系统中设置防火墙开放特定端口就非常必 ...
Linux iptables开放特定端口
如果系统已安装则调过安装步骤 查找安装包 yum list | grep iptables 安装iptables yum install iptables-services 重启防火墙使配置文件生效 ...
LINUX关闭防火墙、开放特定端口等常用操作
1. 重启后永久性生效: 开启:chkconfig iptables on 关闭:chkconfig iptables off 2. 即时生效,重启后失效: 开启:service iptables s ...
linux防火墙开放端口,针对固定ip开放端口
编辑/etc/sysconfig/iptables,添加 -A INPUT -m state --state NEW -m tcp -p tcp -s 127.0.0.1 --dport 6379 - ...
linux下mysql开启远程访问权限 防火墙开放3306端口
linux下mysql开启远程访问权限 防火墙开放3306端口 转载 2017-01-21 作者:JAVA-ANDROID 这篇文章主要为大家详细介绍了linux下mysql开启远程访问权限,防 ...
linux下mysql开启远程访问权限及防火墙开放3306端口
默认mysql的用户是没有远程访问的权限的,因此当程序跟数据库不在同一台服务器上时,我们需要开启mysql的远程访问权限. 主流的有两种方法,改表法和授权法. 相对而言,改表法比较容易一点,个人也是比 ...
随机推荐
iOS之获取屏幕尺寸
//app尺寸,去掉状态栏 CGRect appRect = [UIScreenmainScreen].applicationFrame; NSLog(@"%f, %f, %f,%f&quo ...
input type=";submit"; 和";button";有什么区别?
http://www.zhihu.com/question/20839977 在一个页面上画一个按钮,有四种办法: 这就 ...
Web 在线文件管理器学习笔记与总结(1)初始文件以及获取首层目录信息
在线文件管理器即使用浏览器管理和操作项目中的目录和文件 文件相关操作包括: 1.创建文件 2.判断文件的权限 3.文件的大小 4.文件的创建时间.修改时间.访问时间 5.查看文件的内容 6.修改文件的 ...
hdu 4523 威威猫系列故事——过生日 小模拟
威威猫系列故事——过生日 Time Limit: 500/200 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total ...
[虚拟化/云][全栈demo] 为qemu增加一个PCI的watchdog外设(九)
目的 1. 使用verilog/vhdl设计一个PCI的watchdog设备. 2. 通过systemverilog 写testbench. 很久之前研究过AC97的verilog代码.但是很久没用v ...
mysql 将一个表中的数据复制到另一个表中,sql语句
1.表结构相同的表,且在同一数据库(如,table1,table2) Sql :insert into table1 select * from table2 (完全复制) insert into t ...
node基础—模块系统
模块的概念 为了让Node.js的文件可以相互调用,Node.js提供了一个简单的模块加载系统. 在 Node.js 中,文件和模块是一一对应的(每个文件被视为一个独立的模块),换言之,一个 Node ...
“玲珑杯”ACM比赛 Round #18---图论你先敲完模板(DP+思维)
题目链接 DESCRIPTION INPUT OUTPUT SAMPLE INPUT 2 3 2 3 5 7 3 10 3 5 7 SAMPLE OUTPUT 12 26 HINT 官方题解: 代码如 ...
java web 打水印
/** * 把图片印刷到图片上 * * @param pressImg -- * 水印文件 * @param targetinp -- * 目标文件 * @param x * --x坐标 * @par ...
【02】webstorm配置babel转换器+截图(by魔芋)
[02]webstorm配置babel转换器+截图(by魔芋) [02]魔芋的安装过程 01,配置babel. 02,用webstorm.注意webstorm的版本号. 03,使用 ...