RHEL6.1防火墙配置——以Webmin为例

简介:

Configuring Your RHEL Firewall For Webmin

本文以RHEL6.1为实例,详细讲述了Webmin在RHEL6.1中的安装和配置过程。
着重描述了防火墙规则的设置。

Many operating systems block access to port 10000 by default,

#主要包括RHEL、CentOS。

#不包括ubuntu

as they have a firewall activated as part of the installation process. This may prevent you from logging into http://yourserver:10000/

#RHEL6.1中默认情况下(无DNS,没有修改hosts文件)

#可能不能用主机名称代替localhost,

#使用https://localhost:10000/代替http://yourservername:10000/ 。

#原因如下:

#hosts文件没有解释主机名称

实例:

[root@dgdrhelsrv Downloads]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@dgdrhelsrv Downloads]# 
 

from another system on your network or over the Internet.

The simplest way to open up port 10000 is to use one of the Webmin firewall management modules, such as Linux Firewall, BSD Firewall or IPFilter Firewall. However, to access this you'll need to run a brower on the same system as Webmin, and access it via the URL http://localhost:10000/.

The alternative is to login as root via SSH, and manually edit the firewall configuration file. On Redhat and derived systems, this is /etc/sysconfig/iptables, while on Debian it is /var/lib/iptables. The line you need to add is :

#命令参考如下

su -

vim vim /etc/sysconfig/iptables

编辑如下:

#需要注意的是,要在COMMIT行前添加一个新行。

-A INPUT -p tcp -m tcp --dport 10000 -j ACCEPT

/etc/init.d/iptables restart 

exit

#实例:


[dgd@dgdrhelsrv Downloads]$ su root
Password: 
[root@dgdrhelsrv Downloads]# rpm -i webmin-1.570-1.noarch.rpm 
warning: webmin-1.570-1.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 11f63c51: NOKEY
Operating system is Redhat Enterprise Linux
Webmin install complete. You can now login to https://dgdrhelsrv:10000/
as root with your root password.

[root@dgdrhelsrv Downloads]# vim /etc/sysconfig/iptables
[root@dgdrhelsrv Downloads]# /etc/init.d/iptables restart
iptables: Flushing firewall rules:                               [  OK  ]
iptables: Setting chains to policy ACCEPT: filter    [  OK  ]
iptables: Unloading modules:                                     [  OK  ]
iptables: Applying firewall rules:                               [  OK  ]
[root@dgdrhelsrv Downloads]# 


It should be added in the file just after similar lines which grant access to ports 80, 22 and so on.

#这就是为什么要在COMMIT行前添加的原因。

Once this line has been added, you will need to apply the firewall configuration. This is typically done with the command /etc/init.d/iptables restart .

 



本文转自 urey_pp 51CTO博客,原文链接:http://blog.51cto.com/dgd2010/733411,如需转载请自行联系原作者


相关文章
|
27天前
|
监控 网络协议 安全
华为配置防火墙直连路由器出口实验
华为配置防火墙直连路由器出口实验
|
2月前
|
网络安全 数据中心
百度搜索:蓝易云【Proxmox软件防火墙的配置教程】
现在,你已经完成了Proxmox软件防火墙的配置。请确保你的防火墙规则设置正确,以保护你的Proxmox VE环境免受未经授权的访问和网络攻击。
127 5
|
6月前
|
开发框架 网络协议 Ubuntu
【Linux】配置网络和firewall防火墙(超详细介绍+实战)
【Linux】配置网络和firewall防火墙(超详细介绍+实战)
1260 0
|
9月前
|
网络协议 Linux 网络安全
Centos7 防火墙配置+端口设置
Centos7 防火墙配置+端口设置
207 0
Centos7 防火墙配置+端口设置
|
5月前
|
网络协议 Linux 网络安全
suse 12 配置ip,dns,网关,hostname,ssh以及关闭防火墙
suse 12 配置ip,dns,网关,hostname,ssh以及关闭防火墙
141 0
|
3月前
|
网络协议 Shell Linux
系统初始化shell,包括:挂载镜像、搭建yum、设置主机名及IP地址和主机名映射、配置动态IP、关闭防火墙和selinux
系统初始化shell,包括:挂载镜像、搭建yum、设置主机名及IP地址和主机名映射、配置动态IP、关闭防火墙和selinux
37 2
|
7月前
|
网络协议 Linux 网络安全
百度搜索:蓝易云【Linux 防火墙配置(iptables和firewalld)详细教程。】
以上只是一些常见的iptables和firewalld命令示例,你可以根据自己的需求进行修改和扩展。请注意,在配置防火墙时务必小心,确保不会阻塞你所需要的合法流量,并确保保存和加载配置以使其永久生效。另外,建议在配置防火墙之前备份现有的防火墙规则以防止意外情况发生。
572 2
|
7月前
|
安全 网络安全 网络虚拟化
有配置云防火墙,那么防火墙自然无法发挥其防护功能
有配置云防火墙,那么防火墙自然无法发挥其防护功能
43 2
|
7月前
|
网络协议 安全 Linux
如何在 CentOS 8 上安装和配置配置服务器防火墙 (CSF)?
如何在 CentOS 8 上安装和配置配置服务器防火墙 (CSF)?
156 0
如何在 CentOS 8 上安装和配置配置服务器防火墙 (CSF)?
|
8月前
|
运维 Shell 网络安全
【运维知识进阶篇】iptables防火墙详解(iptables执行过程+表与链概述+iptables命令参数+配置filter表规则+NAT表实现共享上网、端口转发、IP映射)(三)
【运维知识进阶篇】iptables防火墙详解(iptables执行过程+表与链概述+iptables命令参数+配置filter表规则+NAT表实现共享上网、端口转发、IP映射)(三)
1357 0