Red Hat Training
A Red Hat training course is available for Red Hat Enterprise Linux
2.4. 限制对 Piranha Configuration Tool的访问
Piranha Configuration Tool提示一个可用的用户名和密码组合。但所有传递给 Piranha Configuration Tool的数据都是明文的,因此建议您将对它的访问限制在可信的网络或者本地机器。
The easiest way to restrict access is to use the Apache HTTP Server's built in access control mechanisms by editing
/etc/sysconfig/ha/web/secure/.htaccess
. After altering the file you do not have to restart the piranha-gui
service because the server checks the .htaccess
file each time it accesses the directory.
默认情况下,对此目录的访问控制允许任何人浏览目录内容。以下就是默认访文件的形式:
Order deny,allow Allow from all
要将对 Piranha Configuration Tool的访问限制在只允许本地主机访问,请将
.htaccess
文件修改为只允许来自回送设备(127.0.0.1)的访问。有关回送设备的详情请参考Red Hat Enterprise Linux Reference Guide的网络脚本一章。
Order deny,allow Deny from all Allow from 127.0.0.1
本示例中您还可以允许特定主机或者子网:
Order deny,allow Deny from all Allow from 192.168.1.100 Allow from 172.16.57
在本示例中,只有来自 IP 地址为 192.168.1.100 和 172.16.57/24 网络中的机器使用的网页浏览器可访问 Piranha Configuration Tool。
警告
编辑 Piranha Configuration Tool
.htaccess
文件可限制对位于 /etc/sysconfig/ha/web/secure/
目录中的配置页的访问,但不会限制登录和对位于 /etc/sysconfig/ha/web/
目录的帮助页的访问。要限制对此目录的访问,请在 /etc/sysconfig/ha/web/
目录中创建 .htaccess
文件,并使用和 /etc/sysconfig/ha/web/secure/.htaccess
文件一样的 order
、allow
和 deny
行。