hillstone防火墙整理的入门命令

支持 命令自动补全 命令缩写  ?号提示/列出当前模式可用的命令  上下查找历史命令  快捷键参考手册

接口模式下:

manage telnet

manage ssh

show interface e0/0   //查看接口信息

命令模式:

hillstone#

在命令模式输入 configure  进入全局模式

全局配置模式:

hillstone(config)#

子模块配置模式:

hillstone(config-if-eth0/0)#

退回到上一级模式:exit  从任何模式退回到执行模式:end

常见命令语法错误信息:

unrecognized command  命令错误、未被接受  [‘rekeɡnaiz]

incomplete command 命令不完整

ambiguous command 参数不完整

设置连接超时:

configure->ssh/console/telnet timeout 1-60 分钟 默认10分钟

恢复默认设置超时时间:configure->no ssh timeout

设置主机名:configure->hostname NQ

添加管理员admin:

hillstone(config)# admin user admin       //添加admin用户并自动进入用户配置模式

hillstone(config-admin)# ?      

  access            Configure admin’s allowed login access

  password          Configure password of administrator

  privilege         Configure privilege of the administrator

  clear             Reset functions

  debug             Debugging functions

  delete            Delete a file

  end               Exit from configure mode

  exec              Perform command operation

  exit              Exit from Admin configuration mode

  help              CLI help

  no                Negate a command or reset to default

  ping              Test network connectivity

  rollback          Rollback to previous saved configuration

  save              Save configuration

  show              Show running system information

  terminal          Configure terminal line parameters

  traceroute        Trace route to destination

  undebug           Negate debugging functions

  unset             Back to the default configuration

hillstone(config-admin)#

hillstone(config-admin)# privilege RXW //设置完全权限

hillstone(config-admin)# password admin123 //设置密码

hillstone(config-admin)# access https      //添加用户以后是无法登陆的,必须为用户添加可登陆类型的权限,否则会提示密码错误。

hillstone(config-admin)# show admin user  //查看系统中的用户

========================================================

Username        Privilege  Console Telnet SSH HTTP HTTPS

——————————————————–

hillstone       RXW        Y       Y      Y   Y    Y

admin           RX         –       –      –   –    –

hillstone(config)# no admin user admin    //全局模式下删除用户

hillstone(config)# show admin user hillstone   //查看用户具体信息

============================================

admin    : hillstone

privilege: RXW

access   : console telnet ssh http https

password : 52/rxu0vP8f9jQ2alM9l7tQyM

hillstone(config)# show admin host  //查看可信主机配置(访问设备的地址段)

=========================================================================

IP range                                Login type

————————————————————————-

0.0.0.0/0                           Telnet  SSH     HTTP    HTTPS  

————————————————————————-

hillstone(config)# admin host {A,B,C,D A,B,C,D | any } {http | https | ssh | telnet | any }

hillstone(config)# ssh port ?  //设置ssh端口

  <1-65535>         SSH service port(22: default, or <1-65535>)

hillstone(config)# ssh port

hillstone(config)# show ssh  //查看设置ssh的信息 或者是show http

SSH server options:

=============================================================

SSH idle timeout is: 20 minute(s)

SSH server listen port is: 57891

SSH server accept connection interval: 2

=============================================================

hillstone(config)#

hillstone(config)# http port ?  //设置http端口

  <1-65535>         HTTP port (1-65535)

hillstone(config)# https po 

hillstone(config)# https port ?  //设置https端口

  <1-65535>         HTTPS port (1-65535)

hillstone(config)# https port

hillstone(config)# show http  //查看http /https信息

HTTP server options:

=============================================================

web(HTTP/HTTPS) idle timeout is: 10 minute(s)

HTTP port is: 65499

HTTPS port is: 65498

HTTPS trust domain is: trust_domain_default

=============================================================

hillstone(config)#

指定https方式访问时使用的pki信任域,当https启动时,https服务器将使用指定的pki信任域中的证书,默认使用trust_domain_default

在登陆https时无法打开,选用http登陆,修改此项试试。

windows查看dns缓存

C:\dig>ipconfig /displaydns

Windows IP Configuration

    1.0.0.127.in-addr.arpa
    —————————————
    Record Name . . . . . : 1.0.0.127.in-ad
    Record Type . . . . . : 12
    Time To Live  . . . . : 86400
    Data Length . . . . . : 8
    Section . . . . . . . : Answer
    PTR Record  . . . . . : localhost
    mail.mwoopo.com
    —————————————
    Record Name . . . . . : mail.xxx.com
    Record Type . . . . . : 1
    Time To Live  . . . . : 2772
    Data Length . . . . . : 4
    Section . . . . . . . : Answer
    A (Host) Record . . . : 119.167.xxx.xx
    Record Name . . . . . : ns.xinnet.cn
    Record Type . . . . . : 1
    Time To Live  . . . . : 2772
    Data Length . . . . . : 4
    Section . . . . . . . : Additional
    A (Host) Record . . . : 61.135.199.4
    Record Name . . . . . : ns.xinnet.cn
    Record Type . . . . . : 1
    Time To Live  . . . . : 2772
    Data Length . . . . . : 4
    Section . . . . . . . : Additional
    A (Host) Record . . . : 121.14.70.4

apache限制IP访问来源、只允许某个网段访问

      偶然想起一个事情,公司有一个php项目是针对Police,做的一个办公系统,这个系统只针对内网访问,并且只针对某几个ip,某个网段授权访问,之前程序员是在php中读取数据库中的来源IP判定是否有权限访问,那么这样的话,我们运维可以通过apache配置文件限制。

      mod_authz_host提供的指令用在<Directory>, <Files>, <Location>段中,也用于.htaccess文件中控制对服务器特定部分的访问。只要能在环境变量中捕获到主机名、IP地址或其他的客户端请求特征,就可以基于这些特征对访问进行控制。Allow和Deny指令用于指出允许哪些客户及不允许哪些客户访问服务器,而Order指令设置默认的访问状态并配置Allow和Deny指令怎样相互作用。

比如只允许某台主机访问phpmyadmin,在httpd.conf中加代码:

<Directory /var/www/html/pma>

Allow from 1.1.1.2

Deny from All

</Directory>

重启apache

      关于模块的资料参考如下,配置方法very简单,自行参考了,多多看apache 帮助文档还是很有用滴~

https://www.rootop.org/ApacheManual/Apache2.2_zh_CN/mod/mod_authz_host.html

EFS加密后打开文件乱码

原文来自:http://blog.csdn.net/huzgd/article/details/6452571

        EFS是最适合程序员的代码文件加密保护的方法。但我有个同事对我说,NTFS加密非常不可靠,加密后的内容经常是乱码,他已经试过几次,已经是怕了不敢再用了。然后他当着我的面在他的电脑上搞了个大文件夹,右键文件夹属性高级加密并应用到所有子文件,过了一会,他再打开几个加密文件,果然,有一些能正常打开,另外一些就是乱码了(只是乱码,文件可以打开,不是拒绝访问)。加密完成重启了系统后,基本上所有文件都是乱码了。

        对此我也感觉很疑惑,难道微软这么多年搞出来的EFS会有这么严重的问题?为何在我和其他人机器上又没发现呢?用百度搜索了一下,居然也没有找到类似情况。同事的系统是新装的,基本上也不存在有病毒木马的可能。由于他曾经在另一块硬盘的系统上也出现过类似问题,现在是一块新硬盘,因此也排除是硬盘的问题。

         然后我想到,国内来说大家都比较少用EFS加密,会不会国外用户有类似的问题呢?于是用GOOGLE英文搜索了一下,果然找到有人在微软的官网上问过类似的情况,据说是因为用了个叫Comodo antivirus的杀毒软件导致的,详见:

http://social.technet.microsoft.com/Forums/en-US/itprovistaapps/thread/56f59759-ef8e-48d9-98e0-aa13dfe196c1

         当然了,这个杀毒软件在国内没什么人用,我们也没听过,不可能是这个原因。于是接着再搜索,发现有人在用赛门铁克的防毒软件时也会出现类似问题,而赛门铁克我们都有用过,我同事机器系统上也有。再仔细一查,赛门铁克也不是所有版本都有这个问题,而是在10.2.322前的版本才有这个BUG,后来的版本已经修复了,详见:

http://www.symantec.com/business/support/index?page=content&id=TECH102297

        同事机器上的版本恰好是有问题的旧版本赛门铁克,所以导致了EFS解密乱码。而我自己之前用的赛门铁克版本都较新,所以也没有发现这个问题。

        接下来解决方案出来了,要么升级赛门铁克到新版本,要么把赛门铁克禁用。我同事目前是把它禁用了,禁用后EFS解密恢复正常。