in

SDT Community Server

SDT Forums, Blogs, Photos server.

Floating Heart

No description is bad.

October 2006 - Posts

  • 三十岁之前不必在乎的29件事

     【放弃】把握的反面就是放弃,选择了一个机会,就等于放弃了其他所有的可能。 
    当新的机会摆在面前的时候,敢于放弃已经获得的一切,这不是功亏一篑,这不是半途而废, 
    这是为了谋求更大的发展空间;或者什么都不为,只因为喜欢这样做,因为,年轻就是最大的机会。 
    人,只有在三十岁之前才会有这个胆量,有这个资本,有这个资格。 

      
      【失恋】不是不在乎,是在乎不起。三十岁前最怕失去的不是已经拥有的东西,而是梦想。 
    爱情如果只是一个过程,那么正是这个年龄应当经历的,如果要承但结果,三十岁以后, 
    可能会更有能力,更有资格。其实,三十岁之前我们要做的事情很多,稍纵即逝, 
    过久地沉溺在已经干涸的爱河的河床中,与这个年龄的生命节奏不合。 

      【离婚】不是不在乎,是一切还来得及。一位三十八岁的女友与老公结婚十五年, 冷战十三年, 终于分手。她说:“如果说后来不愿意离婚是为了孩子,那第他第一次提出离婚我没有同意, 
    现在想来真不知道为什么。如果个时候早分手,我的生活绝不会是今天这个样子。现在再重新开始, 
    总觉得一切都晚了。” 

      【漂泊】漂泊不是一种不幸,而是一种资格。趁着没有家室拖累,趁着身体健康, 此时不飘何时飘?当然,漂泊的不一定是身体,也许只是幻想和梦境。新世纪的时尚领袖是飘一代, 
    渴望漂泊的人惟一不飘的是那颗心。 

      【失业】三十岁以前就尝到失业的滋味当然是一件不幸的事,但不一定是坏事。 
    三十岁之前就过早地固定在一个职业上终此一生也许才是最大的不幸。 
    失业也许让你想起埋藏很久而尘封的梦想,也许会唤醒连你自己都从未知道的潜能。 
    也许你本来就没什么梦想,这时候也会逼着你去做梦。 

      【时尚】不要追赶时尚。按说青年人应该是最时尚的,但是独立思考和个性生活更重要。 
    在这个物质社会,其实对时尚的追求早已经成为对金钱的追求。今天,时尚是物欲和世俗的同义语。 

      【格调】这是小资的东西,"小资"这个词在今天又二度流行,追求格调就是他们的专利。 
    小资们说,有格调要满足四大要件:智慧、素养、自信和金钱。格调就是把"高尚"理解成穿着、 
    气质、爱好的品位和室内装潢。也就是大老粗只会表现谈吐的庸俗,"小资"们已经有能力庸俗他们的心灵了。主流观念倒不是非要另类,另类已经成为年轻人观念的主流了,在今天,老土倒显得另类。 
    关键是当今社会是一个创造观念的时代,而不是一个固守陈旧观念的时代。 

      【评价】我们最不应该做出的牺牲就是因为别人的评价而改变自我,因为那些对你指手画脚的人 
    自己也不知道他们遵从的规则是什么。千万不要只遵从规矩做事,规矩还在创造之中, 
    要根据自己的判断做每一件事,虽然这样会麻烦一点。 

      【幼稚】不要怕人说我们幼稚,这正说明你还年轻,还充满活力。"成熟"是个吓人的词儿, 
    也是个害人的词儿。成熟和幼稚是对一个人最大而无当、最不负责任、最没用的概括。那些庸人 
    ,绝不会有人说他们幼稚。不信,到哪天你被生活压得老气横秋,暮气沉沉的时候, 
    人们一定会说你成熟了,你就会知道"成熟"是个什么东西。 

      【不适应】在一首摇滚里有这么一句:"这个城市改变了我,这个城市不需要我。 
    "不要盲目地适应你生存的环境,因为很可能这环境自身已经不适应这个社会的发展了。 

      【失败】我的老师曾经跟我说,一个人起码要在感情上失恋一次,在事业上失败一次, 在选择上失误一次,才能长大。不要说失败是成功之母那样的老话,失败来得越早越好, 
    要是三十岁,四十岁之后再经历失败,有些事,很可能就来不及了。 

      【错误】这是年轻人的专利。 

      【浅薄】如果每看一次《泰坦尼克号》就流一次眼泪,每看一次《大话西游》就笑得直不起腰, 就会有人笑你浅薄。其实那只能说明你的神经依旧非常敏锐,对哪怕非常微弱的刺激都会迅速 
    做出适应的反应;等你的感觉迟钝了,人们就会说你深沉了。 

      【明星】不是不必在乎,是不能在乎。明星在商品社会是一种消费品,花了钱,听了歌, 看了电影,明星们的表现再好,不过是物超所值而己,也不值得崇拜呀? 
    就像你在地摊上花五十块钱买的裙子,别人都猜是八百块钱买的,物超所值了吧? 
    你就崇拜上这身裙子了? 


      【代价】不是不计代价,而是要明白做任何事都要付出代价。对我们这个年龄的人来说, 这绝不是一句废话。否则,要到三十岁的时候才会明白自己曾经付出了多少代价, 
    却不明白为什么付出,更不明白自己得到了多少,得到什么。 

      【孤独】这是为自由付出的代价。 

      【失意】包括感情上的,事业上的,也许仅仅是今天花了冤枉钱没买到可心的东西, 朋友家高朋满座自己却插不上一句话。过分在乎失意的感受不是拿命运的捉弄来捉弄自己, 
    就是拿别人的错误来惩罚自己。 

      【缺陷】也许你个子矮,也许你长得不好看,也许你的嗓音像唐老鸭…… 
    那么你的优势就是你不会被自己表面的浅薄的亮点所耽搁,少花一些时间,少走一些弯,直接发现你内在的优势,直接挖掘自己深层的潜能。 

      【误会】如果出于恶意,那么解释也没有用;如果出于善意,就不需要解释。 
    专门说到"误会"倒不是因为一个人在三十岁之前被人误会的时候更多, 
    而是这个年龄的人想不开的时候更多。 

      【谣言】这是一种传染病,沉默是最好的疫苗。除非你能找出传染源, 
    否则解释恰恰会成为病毒传播最理想的条件。 

      【疯狂】这是年轻人最好的心理调适,只能说明你精力旺盛,身心健康。 
    说你"疯狂"是某些生活压抑、心力交瘁的中老年人恶意的评价,他们就像一部年久修的机器, 最需要调试,但只能微调,一次大修就会让他们完全报废。 

      【稳定】三十岁之前就在乎稳定的生活,那只有两种可能,要么就是中了彩票, 要么就是未老先衰。 

      【压力】中年人能够承受多大压力检验的是他的韧性;年轻人能承受多大压力, 焕发的是他的潜能。 

      【出国】也许是个机会,也许是个陷阱。除非从考大学的那一刻你就抱着这个目标, 否则,对待出国的态度应该像对待爱情一样,努力争取成败随缘。 

      【薪水】只要是给人打工,薪水再高也高不到哪儿去。所以在三十岁之前,机会远比金钱重要, 事业远比金钱重要,将来远比金钱重要。对大多数人来说,三十岁之前干事业的首要目标绝不是挣钱, 
    而是挣未来。 

      【存款】这倒不一定是因为我们钱少,年轻人现在谁都知道钱是有生命的。 
    机会这么多,条件这么好,可以拿钱去按揭,做今天的事,花明天的钱;也可以拿钱去投资 
    ,拿钱去"充电"。钱只有在它流通的过程中才是钱,否则只是一沓世界上质量最好的废纸。 

      【房子】除非你买房子是为了升值,要么就是你结婚了。我有个同学,家在外地,大学毕业之后, 单位没有宿舍,家里就给他买了一套房子。他曾经有过去北京工作的机会, 但是他觉得刚买了房子就离开这座城市说不过去,就放弃了。到现在他工作稳定,但一事无成。 唯一的成就就是结婚了,并且有了孩子,因为他觉得该让这房子永远空着,所以房子变成了家。 
    房子是都市生活的寓言,这个寓言不应该过早的和我们相关。 

      【年龄】女孩子一过二十五就开始隐瞒自己的年龄,其实大可不必。 
    现在青年期都延迟到四十五岁了,二十五又算得了什么呢? 

      【在乎】这是一种拿不起、放不下的心态,它的反面不是放弃,而是天马行空,自由自在, 永远保持革命乐观主义的精神。

    Posted Oct 31 2006, 08:36 AM by wicky with no comments
    Filed under:
  • 如何在两台linux服务器之间用RSA键对的方法SSH/SCP不需密码

    http://www.linuxeden.com/doc/19655.html

    Jephe Wu (吴阿亭)
    软硬件环境:
    两台linux服务器A和B
    都编译安装上最新版的openSSH(建议)

    openSSH的默认设置是允许root可以直接login. (PermitRootLogin yes),暂且保留这种设置,我们先考虑如何
    用SSH直接从A到B不需要密码,假设用用户root登录到A,想SSH到B也作为root不需要密码。

    1。 分别从A和B上登录作为root后运行ssh-keygen,目的是简单地在/root下创建目录.ssh,当提示输入
    passphase时打入两次回车。这将生成/root/.ssh/identity and /root/.ssh/identity.pub

    2。 先测试一下,从A登录作为root,打入#ssh B,会要求提示root password。

    3。 现在从A登录作为root,运行scp /root/.ssh/identity.pub B:/root/.ssh/authorized_keys。
    文件名必须不能弄错。

    4。现在再从A运行#ssh B则不需要密码了:)

    基本原理:
    1。 如果你希望从A作为用户user1 SSH 到B 作为用户user2, 若要用RSA键对法认证且不需要密码,则B上的ssh
    后台程序拿出~user2/.ssh/authorized_keys中的与A有关的RSA公钥来对A上的以user1身份运行的ssh客户程序
    进行挑战,前面我们已经把A上的identity.pub拷贝到B上作为authorized_keys了。则A保持私钥identity,而B
    上的sshd又拿出A的公钥来挑战,因此成功,你可以加很多行到authorized_keys以允许其它服务器的公钥可以加
    进来。

    常见应用举例:

    1。 在A上以用户root SSH到B上作为普通用户user而不是root,因为为了安全,有时不需要作为root,只需要作
    为普通用户不需要密码以完成相应工作即可。

    登录作为root在A上
    A# scp /root/.ssh/identity.pub user@B:/home/user/.ssh/authorized_keys

    2. tar一批文件从A到B。
    A# tar cvf - /etc | ( ssh B tar xvf -)

    3. 运行A上的cronjob,对某文件作改动后传到B
    0 1 * * * cat /etc/shadow | awk -F: {print $1":"$2} | (ssh B cat > /home/passwd)

    常见问题:
    1。 这种方式的SSH需要B上的sshd_config中允许直接的root login (PermitRootLogin yes).
    2. 我有服务器A和其它服务器B,C,D。我想从A SSH到这些服务器但不要自动,最好输入RSA passphase,但太
    麻烦,怎么办?
    a. 要A上运行ssh-keygen时输入passphase字。
    b. 要登录到A上后运行A#ssh-agent bash
    c. 再运行ssh-add加passphase进入内存
    d. 再运行ssh B or SSH C or SSH D,则不再需要密码,密码对只需输一次

    e. 最后退出shell前输入ssh-agent -k 。
    Posted Oct 30 2006, 03:16 PM by wicky with no comments
    Filed under:
  • 如何使用SSH的Port Forwarding加密不安全的服务

    http://fanqiang.chinaunix.net/a6/b9/20010912/1200001279.html

    一。简介: 

          大多数人知道SSH是用来替代R命令集,是用于加密的远程登录,文件传输,甚至加密的 
          FTP(SSH2内置), 因此SSH成为使用极广的服务之一,不仅如此,SSH还有另一项非常有 
          用的功能,就是它的端口转发隧道功能,利用此功能,让一些不安全的服务象POP3, 
          SMTP,FTP,LDAP等等通过SSH的加密隧道传输,然后,既然这些服务本身是不安全的, 
          密码和内容是明文传送的,现在其它中间媒介也没无监听了。 

          二。图示: 

          SSH的加密隧道保护的只是中间传输的安全性,使得任何通常的嗅探工具软件无法获取发 
          送内容。如下图: 
          假设客户机和服务器都运行Linux,且以POP3为例。 


               C (pop3 server: S)              S 
            _______                         ________                 
            |     |                         |      | 
            |     |________POP3___________ >|      | 
            |_____|                         |______| 
                      (图一:正常的POP3) 


          (图一:正常的POP3) 


               C (pop3 server:C)               S (pop3 client: S) 
            _______                         ________                 
            |     |                         |      | 
            |     |--------SSH连接--------->|      | 
            |_____|                         |______| 
             
             
          (图二:SSH隧道后的POP3) 
           

          如图一: 正常的POP3连接是客户C向服务器S进行连接,C的设置是POP3服务器为S。 
          如图二: 用SSH隧道的话,客户C设置pop3服务器为自己(localhost),然后设置SSH加密 
          隧道 
          ,如果设置在同样的端口110听取C的请求,则对C来说,pop3服务器是自己本身,端口也 
          是110 对S来说,看到的pop3请求地址不是来自C,而也是自己本身,因为有了SSH隧道。 



          三。SSH隧道设置 

          1. 首先必须在C和S上安装SSH,确保SSH首先能工作。 
          2. 我们用简单的一个命令如下: 

          # ssh -C -P -f sshaccount@S -L 110:S:110 sleep 7200 

          解释如下: 
          -C 使用压缩功能,是可选的,加快速度。 

          -P 用一个非特权端口进行出去的连接。 

          -f 一旦SSH完成认证并建立port forwarding,则转入后台运行。 

          sshaccount 客户C在服务器S上的SSH连接帐号 

          -L 110:S:110 转发C对本地端口110的连接到远程服务器S的110端口。 
          也可以用高端端口(普通用户使用,因为普通用户不能在低于1024的端口上建立SSH隧道) 
          如果用高端端口,如:-L 1110:S:110,这样任何用户都可建立这种加密隧道。 

          sleep 7200 一般用于script,必须给一个命令,我们给一个sleep等待空 命令,这里为 
          2小时,你可以 
          设为更长用于保持整个连接过程, 如 sleep 100000000 。 

          四。检验 

          设置后你就可以在客户C上用 # telnet localhost 110 命令而连到 S 上收取email, 
          而整个过程也被加密。 

          五。其它常见问题: 

          1. 每次启动该命令时需要输入密码以验证SSH连接,你也可以用RSA键对的方法自动化 
          SSH连接。 
          看文章荟萃中的另一篇文章《如何在两台linux服务器之间用RSA键对的方法SSH/SCP不需 
          密码》 

          2. 如果你希望上面的命令永远保持运行状态,你可以用如下的scripts. 
          #!/bin/sh 
          while [ 1 ] ; do 
          ssh -C -P -f sshaccount@S -L 110:S:110 sleep 7200 
          sleep 1 
          done 

          3. 你可以在一个命令中用多个L 参数 ,如 -L 1110:S:110 -L 225:S:25 -L 
          389:S:389 

          4. 一些windows客户端软件,象netscape mail,不能改变pop3端口号,被强迫到110, 
          则你只能指定110 

          5. Linux下的fetchmail常用来自动接收邮件,可在.fetchmailrc中利用 
          preconnect参数预连接 ,指定上面的命令行。 

          6. 如果客户端是windows, 则可用tera Term pro,参考 
          http://www.phys.washington.edu/Computing/winftpssh.html 


          吴阿亭 
          END  
    Posted Oct 30 2006, 02:56 PM by wicky with no comments
    Filed under:
  • Implementing SSH port forwarding with Data Guard

    Subject: Implementing SSH port forwarding with Data Guard
      Doc ID: Note:225633.1 Type: BULLETIN
      Last Revision Date: 28-JUL-2006 Status: PUBLISHED
    
    Overview
    -----------
    
    Data Guard sends redo data across the network to the standby system using Oracle
    Net.  Currently, customers using Data Guard in Oracle9i and up use features available
    with network hardware (e.g. routers) to compress and encrypt this network traffic.
    This paper describes how Secure Shell (SSH) Tunneling can be used with Data Guard
    as an integrated way to encrypt and compress the redo data before it is 
    transmitted by the primary system, and subsequently decrypt and uncompress the 
    redo data when it is received by the standby system.
    
    The detailed steps below cover both the single instance production and standby case,
    and a Maximum Availability Architecture (MAA) environment where both the production
    and standby database are running Real Application Clusters (RAC).  This document does
    not explain how to install and configure SSH for general use.  Refer to your SSH
    documentation for installation and configuration details.  A working and properly
    configured SSH installation is a prerequisite for proceeding with the instructions
    below.
    
    
    Considerations about setting up SSH port forwarding:
    -----------------------------------------------------
    
    - In addition to the network, connectivity between the production and standby 
      systems (as far as Data Guard is concerned) becomes dependent on the ssh and 
      sshd processes, introducing additional points of potential failure.  An ssh or
      sshd failure will appear to Data Guard exactly as a network outage.  Some type
      of automatic restart should be employed (e.g. UNIX inittab entry with a 
      respawn action, or a Windows service).  With the proper REOPEN and MAX_FAILURE
      attribute settings, coupled with the process restart, we should be able to keep
      outage times at a minimum.  Also, using the ALTERNATE log_archive_dest 
      attribute to point to another log_archive_dest that specifies a service that 
      is direct connect (instead of through the SSH tunnel) would provide protection
      from SSH problems that cannot be resolved with a simple restart. Note that using
      an alternate log_archive_dest that does not provide encryption may violate your
      security policies.
    
    - As shown in the examples below, an SSH tunnel should be created in both directions
      between the production and standby systems:
    
           - From production to standby for redo data (via ARCH or LGWR) going to RFS
           - From standby to production for FAL requests
    
    - Although not shown in the examples, if using cascading standby databases (i.e. a 
      standby database that receives its redo logs from another standby database, not 
      from the original primary database), like between the production and standby systems,
      an SSH tunnel would need to be created in both directions between the two standby
      systems:
    
            - From standby1 to standby2 for RFS
            - From standby2 to standby1 for FAL requests
    
    
    -  The sshd daemon configuration on each host must allow TCP port forwarding.  See 
       the sshd_config(5) man page for details of the AllowTcpForwarding configuration 
       parameter.
    
    -  Each ssh command may require it’s own window with the process running in the 
       foreground.  Ssh cannot be put in the background if a password or passphrase is 
       required.  If ssh is configured for promptless access to the remote systems, the ssh
       commands can run in the background and the –n option should be used.  See the ssh(1)
       man page for further details.  If OpenSSH is being used, the command line option –N
       is useful because it does not execute a remote command.  See the OpenSSH ssh(1) man
       page for details.
    
    -  The examples shown below have been tested using SSH version 1.2.31 on Sun Solaris8
       with Oracle9i Release 2 (9.2).  Although it has not been verified, SSH tunneling of
       Data Guard network traffic should work on any platform that supports SSH, and with
       any version of SSH that supports tunneling.  Tunnelling Data Guard network traffic
       through SSH is transparent to Oracle, so there is no Oracle version dependency.
       Thus the following procedure can be used from Oracle9i and up.
    
    
    Verifying SSH port forwarding works:
    -------------------------------------
    
    To verify SSH is setup correctly to allow port forwarding, run the following test to 
    forward telnet requests (default port 23) from the production system to the standby 
    system (in the examples below, the production system is hasun23 and the standby system
    is hasun25):
    
    On the production system (i.e. hasun23) as the oracle user:
    
    $ ssh –L 9000:hasun25:23 oracle@hasun25	  # to setup the tunnel
    $ telnet localhost 9000	                  # this should forward telnet request to
                                              # telnet daemon on hasun25
    
    If the simple port forward of telnet requests does not work, the SSH configuration 
    must be fixed before attempting to use it with Data Guard.  SSH setup and 
    configuration information must be obtained from your SSH documentation or your SSH 
    vendor.
    
    
    Configuring SSH port forwarding in a single instance environment:
    ------------------------------------------------------------------
    
    In the following example, hasun23 is the primary system and hasun25 is the standby
    system.  The Oracle Net listener is listening on port 1525 on both the production 
    and standby systems. Ports 9023 and 9025, as specified below in the forwarding 
    syntax and the Oracle Net connect descriptor definition, are just unused, 
    non-privileged ports.
    
    The Data Guard and Oracle Net setup prior to setting up SSH tunneling will usually
    be similar to the following.
    
        On hasun23:
    
        dg=
           (DESCRIPTION=
              (ADDRESS_LIST=
                 (ADDRESS=(PROTOCOL=tcp)(PORT=1525)(HOST=hasun25)))
              (CONNECT_DATA=(SERVICE_NAME=sales)))
    
        On hasun25:
    
        dg=
           (DESCRIPTION=
               (ADDRESS_LIST=
                  (ADDRESS=(PROTOCOL=tcp)(PORT=1525)(HOST=hasun23)))
               (CONNECT_DATA=(SERVICE_NAME=sales)))
    
    
    Database parameters utilizing the above Oracle Net service names would appear as:
    
        log_archive_dest_2=”service=dg …”
        fal_client=dg
        fal_server=dg
    
    
    To modify the above configuration to utilize SSH to forward Data Guard Oracle Net 
    traffic consists of the following three steps:
    
    1.  Setup SSH to allow port forwarding.
    
        On hasun23 as the oracle user:
        
        $ ssh -C -L 9025:hasun25:1525 oracle@hasun25
        
        On hasun25 as the oracle user:
        
        $ ssh –C –L 9023:hasun23:1525 oracle@hasun23
    
    2.  The new Oracle Net service name is copied from the original and modified as shown
        below.
    
        On hasun23:
     
        dg_ssh=
           (DESCRIPTION=
              (ADDRESS_LIST=
                 (ADDRESS=(PROTOCOL=tcp)(PORT=9025)(HOST=localhost))
                 (ADDRESS=(PROTOCOL=tcp)(PORT=1525)(HOST=hasun25)))
              (CONNECT_DATA=(SERVICE_NAME=sales)(SERVER=dedicated)))
    
       On hasun25:
    
       dg_ssh=
          (DESCRIPTION=
             (ADDRESS_LIST=
                (ADDRESS=(PROTOCOL=tcp)(PORT=9023)(HOST=localhost))
                (ADDRESS=(PROTOCOL=tcp)(PORT=1525)(HOST=hasun23)))
             (CONNECT_DATA=(SERVICE_NAME=sales)(SERVER=dedicated)))
    
    3.  Change the following database parameters on all systems to use the new Oracle 
        Net service name definition.
    
        log_archive_dest_2=”service=dg_ssh …”
        fal_client=dg_ssh
        fal_server=dg_ssh
    
        The database parameters can be changed dynamically using the ALTER SYSTEM 
        statement. Changes to LOG_ARCHIVE_DEST_2 will take effect at the next log switch.
        Changes to FAL_CLIENT and FAL_SERVER will take effect the next time FAL is 
        initiated to resolve an archive gap.
    
        SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2=’service=dg_ssh’;
        SQL> ALTER SYSTEM SET FAL_CLIENT=dg_ssh;
        SQL> ALTER SYSTEM SET FAL_SERVER=dg_ssh;
    
    
    
    Configuring SSH port forwarding in an MAA environment:
    -------------------------------------------------------
    
    In the following example, hasun23 and hasun24 comprise the primary system while
    hasun25 and hasun26 makeup the standby system. The Oracle Net listener is listening
    on port 1525 on both the production and standby systems.  Ports 9023, 9024, 9025, 
    and 9026, as specified below in the forwarding syntax and the Oracle Net connect 
    descriptor definition, are just unused, non-privileged ports 
    
    A Data Guard and Oracle Net configuration that is configured as described in the 
    Maximum Availability Architecture paper and does not utilize SSH port forwarding 
    will usually be similar to the following:
    
        On hasun23, hasun24:
    
        dg=
            (DESCRIPTION=
               (ADDRESS_LIST=
                  (ADDRESS=(PROTOCOL=tcp)(PORT=1525)(HOST=hasun25))
                  (ADDRESS=(PROTOCOL=tcp)(PORT=1525)(HOST=hasun26)))
               (CONNECT_DATA=(SERVICE_NAME=sales)))
    
        On hasun25, hasun26:
    
        dg=
           (DESCRIPTION=
              (ADDRESS_LIST=
                 (ADDRESS=(PROTOCOL=tcp)(PORT=1525)(HOST=hasun23))
                 (ADDRESS=(PROTOCOL=tcp)(PORT=1525)(HOST=hasun24)))
              (CONNECT_DATA=(SERVICE_NAME=sales)))
    
    Database parameters utilizing the above Oracle Net service names would appear as 
    follows for all systems:
    
        log_archive_dest_2=”service=dg …”
        fal_client=dg
        fal_server=dg
    
    Setting up SSH to forward Data Guard Oracle Net traffic consists of 3 steps:
    
    1.  Setting up the SSH to allow port forwarding.
    
        On hasun23 as the oracle user:
    
        $ ssh –C –L 9025:hasun25:1525 oracle@hasun25
        $ ssh –C –L 9026:hasun26:1525 oracle@hasun26
    
        On hasun24 as the oracle user:
    
        $ ssh –C –L 9025:hasun25:1525 oracle@hasun25
        $ ssh –C –L 9026:hasun26:1525 oracle@hasun26
    
        On hasun25 as the oracle user:
    
        $ ssh –C –L 9023:hasun23:1525 oracle@hasun23
        $ ssh –C –L 9024:hasun24:1525 oracle@hasun24
    
        On hasun26 as the oracle user:
    
        $ ssh –C –L 9023:hasun23:1525 oracle@hasun23
        $ ssh –C –L 9024:hasun24:1525 oracle@hasun24
    
    
    2.  The new Oracle Net service name is copied from the original and modified as shown
        below.
    
       On hasun23, hasun24:
    
        dg_ssh=
           (DESCRIPTION=
              (ADDRESS_LIST=
                 (ADDRESS=(PROTOCOL=tcp)(PORT=9025)(HOST=localhost))
                 (ADDRESS=(PROTOCOL=tcp)(PORT=1525)(HOST=hasun25))
                 (ADDRESS=(PROTOCOL=tcp)(PORT=9026)(HOST=localhost))
                 (ADDRESS=(PROTOCOL=tcp)(PORT=1525)(HOST=hasun26)))
              (CONNECT_DATA=(SERVICE_NAME=sales)(SERVER=dedicated)))
    
        On hasun25, hasun26:
    
        dg_ssh=
           (DESCRIPTION=
              (ADDRESS_LIST=
                 (ADDRESS=(PROTOCOL=tcp)(PORT=9023)(HOST=localhost))
                 (ADDRESS=(PROTOCOL=tcp)(PORT=1525)(HOST=hasun23))
                 (ADDRESS=(PROTOCOL=tcp)(PORT=9024)(HOST=localhost))
                 (ADDRESS=(PROTOCOL=tcp)(PORT=1525)(HOST=hasun24)))
              (CONNECT_DATA=(SERVICE_NAME=sales)(SERVER=dedicated))) 
    
    3.  Change the following database parameters on all systems to use the new Oracle 
        Net service name definition.
    
        log_archive_dest_2=”service=dg_ssh …” 
        fal_client=dg_ssh
        fal_server=dg_ssh
    
        The database parameters can be changed dynamically using the ALTER SYSTEM 
        statement.  Changes to LOG_ARCHIVE_DEST_2 will take effect at the next log switch.
        Changes to FAL_CLIENT and FAL_SERVER will take effect the next time FAL is 
        initiated to resolve an archive gap.
    
        SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2=’service=dg_ssh’;
        SQL> ALTER SYSTEM SET FAL_CLIENT=dg_ssh;
        SQL> ALTER SYSTEM SET FAL_SERVER=dg_ssh;
    
    
    Testing Results
    ------------------
    
    The results below are expressed as the difference of a primary database remotely 
    archiving using the ARCH process with no SSH port forwarding versus that of one 
    with SSH port forwarding (compression enabled).
    
    ARCH:
    ------
    
    Remotely archiving with the ARCH process in conjunction with SSH port forwarding 
    showed the following characteristics when compared to the baseline:
    
    -  Significant reduction in network traffic
    -  No change in primary database throughput
    -  Minimal increase in cpu usage
    
    When remotely archiving using the ARCH attribute, redo logs are transmitted to the 
    destination during an archival operation. The background archiver processes (ARCn) 
    or a foreground archival operation serves as the redo log transport service.  Using
    ARCH to remotely archive does not impact the primary database throughput as long as
    enough redo log groups exist so that the most recently used group can be archived 
    before it must be reopened. Using SSH port forwarding in conjunction with remote 
    archiving with the ARCH process also did not negatively impact the throughput of 
    the primary database. Using SSH port forwarding with compression disabled had 
    minimal cpu impact.  Using with compression enabled also had minimal cpu impact 
    while achieving a significant reduction in network traffic.
    
    
    LGWR ASYNC:
    ------------
    
    Asynchronously archiving with the LGWR process in conjunction with SSH port forwarding
    showed the following characteristics when compared to the baseline:
    
    -  Significant reduction in network traffic
    -  Slight increase in primary database throughput
    -  Minimal increase in cpu usage
    
    When using LGWR to remotely archive in ASYNC mode, the LGWR process  does not wait 
    for each network I/O to complete before proceeding. This behavior is made possible 
    by the use of an intermediate process, known as a LGWR network server process (LNS),
    that performs the actual network I/O and waits for each network I/O to complete.  
    Each LNS has a user configurable buffer that is used to accept outbound redo data 
    from the LGWR. This is configured by specifying the size in 512 byte blocks on the 
    ASYNC attribute in the archivelog destination parameter. For example ASYNC=2048 
    indicates a 1Mb buffer.    As long as the LNS process is able to empty this buffer 
    faster than the LGWR can fill it, the LGWR will never stall. If the LNS cannot keep
    up, then the buffer will become full and the LGWR will stall until either sufficient
    buffer space is freed up by a successful network transmission or a timeout occurs.
    
    Reducing network traffic in a network with high round trip times (RTT) reduces 
    network server timeouts due to buffer full conditions, thus reducing the impact to 
    the primary database throughput. ASYNC can improve the primary database throughput 
    due to the fact that by compressing the redo traffic, the transfer (in 1 MB chunks)
    is quicker and thus the ASYNC buffer doesn't reach full capacity as often, thereby 
    avoiding the wait that can occur when the buffer is full.
    
    
    LGWR SYNC:
    ------------
    
    Synchronously archiving with the LGWR process in conjunction with SSH port forwarding
    showed the following characteristics when compared to the baseline:
    
    -  Significant reduction in network traffic
    -  Decrease in primary database throughput
    -  Minimal increase in cpu usage
    
    The SYNC attribute with the LGWR process specifies that network I/O is to be 
    performed synchronously for the destination, which means that once the I/O is 
    initiated, the archiving process waits for the I/O to complete before continuing.  
    If you specify the SYNC attribute, all network I/O operations are performed 
    synchronously, in conjunction with each write operation to the online redo log. The
    transaction is not committed on the primary database until the redo data necessary 
    to recover that transaction is received by the destination. 
    
    Due to the smaller size of the network I/O's, testing showed that more time was spent
    compressing the transactions than was gained from more efficent network tranmissions.
    The result is descreased primary database throughput.  For this reason, it is not 
    recommended to utilize SSH p
    
    Posted Oct 30 2006, 11:26 AM by wicky with no comments
    Filed under:
  • How to disable Dr. Watson for Windows

    http://support.microsoft.com/kb/188296

    This article was previously published under Q188296
    IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:
    256986 (http://support.microsoft.com/kb/256986/EN-US/) Description of the Microsoft Windows Registry
    var sectionFilter = "type != 'notice' && type != 'securedata' && type != 'querywords'"; var tocArrow = "/library/images/support/kbgraphics/public/en-us/downarrow.gif"; var depthLimit = 10; var depth3Limit = 10; var depth4Limit = 5; var depth5Limit = 3; var tocEntryMinimum = 1; .toc{display: none;}

    SUMMARY

    loadTOCNode(1, 'summary');
    This article describes how to disable and re-enable the Dr. Watson program for Windows.

    MORE INFORMATION

    loadTOCNode(1, 'moreinformation');
    WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.
    Note Because there are several versions of Microsoft Windows, the following steps may be different on your computer. If they are, see your product documentation to complete these steps.

    To disable Dr. Watson

    loadTOCNode(2, 'moreinformation');
    1. Click Start, click Run, type regedit.exe in the Open box, and then click OK.
    2. Locate and click the following registry key:
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AeDebug
    NOTE: Steps three and four are optional, but they necessary if you want to restore the default use of Dr. Watson.
    3. Click the AeDebug key, and then click Export Registry File on the Registry menu.
    4. Enter a name and location for the saved registry file, and then click Save.
    5. Delete the AeDebug key.
    Registry entries for debugger programs are located in the AeDebug key in Windows. The Dr. Watson program is installed by default in Windows, and is configured to run when an application error occurs (with a data value of 1 for the Auto value). The default values are:
    Value Name = Auto
    Type = String (REG_SZ)
    Data Value = 1 or 0. (Default is 1)

    Value Name = Debugger
    Type = String (REG_SZ)
    Data Value = drwtsn32 -p %ld -e %ld -g

    NOTE: This data value (drwtsn32 -p %ld -e %ld -g) is specific to Dr. Watson. Alternative debuggers will have their own values and parameters.

    To enable Dr. Watson

    loadTOCNode(2, 'moreinformation');
    1. At a command prompt, type the following line, and then press ENTER:

    drwtsn32 -i
    2. Double-click the .reg file you created in steps three and four above.

    APPLIES TO
    Microsoft Windows XP Home Edition
    Microsoft Windows XP Professional
    Microsoft Windows Server 2003, Standard Edition (32-bit x86)
    Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
    Microsoft Windows 2000 Server
    Microsoft Windows 2000 Advanced Server
    Microsoft Windows 2000 Professional Edition
    Microsoft Windows 2000 Datacenter Server
    Microsoft Windows NT Workstation 4.0 Developer Edition
    Microsoft Windows NT Server 4.0 Standard Edition
    Microsoft Windows NT Server 4.0 Enterprise Edition
    Keywords: 
    kbhowto KB188296
    Posted Oct 27 2006, 03:02 PM by wicky with no comments
    Filed under:
  • linux上ssh配置指南

    http://xzh2000.itpub.net/post/96/24631

    发表人:xzh2000 | 发表时间: 2005年四月01日, 19:32

    介绍SSH
    什么是SSH?
    传统的网络服务程序,如:ftp、pop和telnet在本质上都是不安全的,因为它们在网络上用明文传送口令和数据,别有用心的人非常容易就可以截获这些口令和数据。而且,这些服务程序的安全验证方式也是有其弱点的,就是很容易受到“中间人”(man-in-the-middle)这种方式的攻击。所谓“中间人”的攻击方式,就是“中间人”冒充真正的服务器接收你的传给服务器的数据,然后再冒充你把数据传给真正的服务器。服务器和你之间的数据传送被“中间人”一转手做了手脚之后,就会出现很严重的问题。

    SSH的英文全称是Secure SHell。通过使用SSH,你可以把所有传输的数据进行加密,这样“中间人”这种攻击方式就不可能实现了,而且也能够防止DNS和IP欺骗。还有一个额外的好处就是传输的数据是经过压缩的,所以可以加快传输的速度。SSH有很多功能,它既可以代替telnet,又可以为ftp、pop、甚至ppp提供一个安全的“通道”。

    最初SSH是由芬兰的一家公司开发的。但是因为受版权和加密算法的限制,现在很多人都转而使用OpenSSH。OpenSSH是SSH的替代软件,而且是免费的,可以预计将来会有越来越多的人使用它而不是SSH。

    SSH是由客户端和服务端的软件组成的,有两个不兼容的版本分别是:1.x和2.x。用SSH 2.x的客户程序是不能连接到SSH 1.x的服务程序上去的。OpenSSH 2.x同时支持SSH 1.x和2.x。

    SSH的安全验证是如何工作的
    从客户端来看,SSH提供两种级别的安全验证。

    第一种级别(基于口令的安全验证)只要你知道自己帐号和口令,就可以登录到远程主机。所有传输的数据都会被加密,但是不能保证你正在连接的服务器就是你想连接的服务器。可能会有别的服务器在冒充真正的服务器,也就是受到“中间人”这种方式的攻击。

    第二种级别(基于密匙的安全验证)需要依靠密匙,也就是你必须为自己创建一对密匙,并把公用密匙放在需要访问的服务器上。如果你要连接到SSH服务器上,客户端软件就会向服务器发出请求,请求用你的密匙进行安全验证。服务器收到请求之后,先在你在该服务器的家目录下寻找你的公用密匙,然后把它和你发送过来的公用密匙进行比较。如果两个密匙一致,服务器就用公用密匙加密“质询”(challenge)并把它发送给客户端软件。客户端软件收到“质询”之后就可以用你的私人密匙解密再把它发送给服务器。

    用这种方式,你必须知道自己密匙的口令。但是,与第一种级别相比,第二种级别不需要在网络上传送口令。

    第二种级别不仅加密所有传送的数据,而且“中间人”这种攻击方式也是不可能的(因为他没有你的私人密匙)。但是整个登录的过程可能需要10秒。

    安装并测试OpenSSH
    因为受到美国法律的限制,在很多Linux的发行版中都没有包括OpenSSH。但是,可以从网络上下载并安装OpenSSH(有关OpenSSH的安装和配置请参考:http://www.linuxaid.com.cn/engineer/brimmer/html/OpenSSH.htm)。

    安装完OpenSSH之后,用下面命令测试一下:

    ssh -l [your accountname on the remote host] [address of the remote host]

    如果OpenSSH工作正常,你会看到下面的提示信息:

    The authenticity of host [hostname] can't be established.
    Key fingerprint is 1024 5f:a0:0b:65:d3:82:df:ab:44:62:6d:98:9c:fe:e9:52.
    Are you sure you want to continue connecting (yes/no)?

    OpenSSH告诉你它不知道这台主机,但是你不用担心这个问题,因为你是第一次登录这台主机。键入“yes”。这将把这台主机的“识别标记”加到“~/.ssh/know_hosts”文件中。第二次访问这台主机的时候就不会再显示这条提示信息了。

    然后,SSH提示你输入远程主机上你的帐号的口令。输入完口令之后,就建立了SSH连接,这之后就可以象使用telnet那样使用SSH了。

    SSH的密匙
    生成你自己的密匙对
    生成并分发你自己的密匙有两个好处:

    1) 可以防止“中间人”这种攻击方式

    2) 可以只用一个口令就登录到所有你想登录的服务器上

    用下面的命令可以生成密匙:

    ssh-keygen

    如果远程主机使用的是SSH 2.x就要用这个命令:

    ssh-keygen –d

    在同一台主机上同时有SSH1和SSH2的密匙是没有问题的,因为密匙是存成不同的文件的。

    ssh-keygen命令运行之后会显示下面的信息:

    Generating RSA keys: ............................ooooooO......ooooooO
    Key generation complete.
    Enter file in which to save the key (/home/[user]/.ssh/identity):
    [按下ENTER就行了]
    Created directory '/home/[user]/.ssh'.
    Enter passphrase (empty for no passphrase):
    [输入的口令不会显示在屏幕上]
    Enter same passphrase again:
    [重新输入一遍口令,如果忘记了口令就只能重新生成一次密匙了]
    Your identification has been saved in /home/[user]/.ssh/identity.
    [这是你的私人密匙]
    Your public key has been saved in /home/[user]/.ssh/identity.pub.
    The key fingerprint is: 2a:dc:71:2f:27:84:a2:e4:a1:1e:a9:63:e2:fa:a5:89 [user]@[local machine]

    “ssh-keygen –d”做的是几乎同样的事,但是把一对密匙存为(默认情况下)“/home/[user]/.ssh/id_dsa”(私人密匙)和“/home/[user]/.ssh/id_dsa.pub”(公用密匙)。

    现在你有一对密匙了:公用密匙要分发到所有你想用ssh登录的远程主机上去;私人密匙要好好地保管防止别人知道你的私人密匙。用“ls –l ~/.ssh/identity”或“ls –l ~/.ssh/id_dsa”所显示的文件的访问权限必须是“-rw-------”。

    如果你怀疑自己的密匙已经被别人知道了,不要迟疑马上生成一对新的密匙。当然,你还要重新分发一次公用密匙。

    分发公用密匙
    在每一个你需要用SSH连接的远程服务器上,你要在自己的家目录下创建一个“.ssh”的子目录,把你的公用密匙“identity.pub” 拷贝到这个目录下并把它重命名为“authorized_keys”。然后执行:

    chmod 644 .ssh/authorized_keys

    这一步是必不可少的。如果除了你之外别人对“authorized_keys”文件也有写的权限,SSH就不会工作。

    如果你想从不同的计算机登录到远程主机,“authorized_keys”文件也可以有多个公用密匙。在这种情况下,必须在新的计算机上重新生成一对密匙,然后把生成的“identify.pub”文件拷贝并粘贴到远程主机的“authorized_keys”文件里。当然在新的计算机上你必须有一个帐号,而且密匙是用口令保护的。有一点很重要,就是当你取消了这个帐号之后,别忘了把这一对密匙删掉。

    配置SSH
    配置客户端的软件
    OpenSSH有三种配置方式:命令行参数、用户配置文件和系统级的配置文件(“/etc/ssh/ssh_config”)。命令行参数优先于配置文件,用户配置文件优先于系统配置文件。所有的命令行的参数都能在配置文件中设置。因为在安装的时候没有默认的用户配置文件,所以要把“/etc/ssh/ssh_config”拷贝并重新命名为“~/.ssh/config”。

    标准的配置文件大概是这样的:

    [lots of explanations and possible options listed]
    # Be paranoid by default
    Host *
    ForwardAgent no
    ForwardX11 no
    FallBackToRsh no

    还有很多选项的设置可以用“man ssh”查看“CONFIGURATION FILES”这一章。

    配置文件是按顺序读取的。先设置的选项先生效。

    假定你在www.foobar.com上有一个名为“bilbo”的帐号。而且你要把“ssh-agent”和“ssh-add”结合起来使用并且使用数据压缩来加快传输速度。因为主机名太长了,你懒得输入这么长的名字,用“fbc”作为“www.foobar.com”的简称。你的配置文件可以是这样的:

    Host *fbc
    HostName www.foobar.com
    User bilbo
    ForwardAgent yes
    Compression yes
    # Be paranoid by default
    Host *
    ForwardAgent no
    ForwardX11 no
    FallBackToRsh no

    你输入“ssh fbc”之后,SSH会自动地从配置文件中找到主机的全名,用你的用户名登录并且用“ssh-agent”管理的密匙进行安全验证。这样很方便吧!

    用SSH连接到其它远程计算机用的还是“paranoid(偏执)”默认设置。如果有些选项没有在配置文件或命令行中设置,那么还是使用默认的“paranoid”设置。

    在我们上面举的那个例子中,对于到www.foobar.com的SSH连接:“ForwardAgent”和“Compression”被设置为“Yes”;其它的设置选项(如果没有用命令行参数)“ForwardX11”和“FallBackToRsh”都被设置成“No”。

    其它还有一些需要仔细看一看的设置选项是:

    l CheckHostIP yes

    这个选项用来进行IP地址的检查以防止DNS欺骗。

    l CompressionLevel

    压缩的级别从“1”(最快)到“9”(压缩率最高)。默认值为“6”。

    l ForwardX11 yes

    为了在本地运行远程的X程序必须设置这个选项。

    l LogLevel DEBUG

    当SSH出现问题的时候,这选项就很有用了。默认值为“INFO”。

    配置服务端的软件
    SSH服务器的配置使用的是“/etc/ssh/sshd_config”配置文件,这些选项的设置在配置文件中已经有了一些说明而且用“man sshd”也可以查看帮助。请注意OpenSSH对于SSH 1.x和2.x没有不同的配置文件。

    在默认的设置选项中需要注意的有:

    l PermitRootLogin yes

    最好把这个选项设置成“PermitRootLogin without-password”,这样“root”用户就不能从没有密匙的计算机上登录。把这个选项设置成“no”将禁止“root”用户登录,只能用“su”命令从普通用户转成“root”。

    l X11Forwarding no

    把这个选项设置成“yes”允许用户运行远程主机上的X程序。就算禁止这个选项也不能提高服务器的安全因为用户可以安装他们自己的转发器(forwarder),请参看“man sshd”。

    l PasswordAuthentication yes

    把这个选项设置为“no”只允许用户用基于密匙的方式登录。这当然会给那些经常需要从不同主机登录的用户带来麻烦,但是这能够在很大程度上提高系统的安全性。基于口令的登录方式有很大的弱点。

    l # Subsystem /usr/local/sbin/sftpd

    把最前面的#号去掉并且把路径名设置成“/usr/bin/sftpserv”,用户就能使用“sftp”(安全的FTP)了(sftpserv在sftp软件包中)。因为很多用户对FTP比较熟悉而且“scp”用起来也有一些麻烦,所以“sftp”还是很有用的。而且2.0.7版本以后的图形化的ftp工具“gftp”也支持“sftp”。

    拷贝文件
    用“scp”拷贝文件
    SSH提供了一些命令和shell用来登录远程服务器。在默认情况下它不允许你拷贝文件,但是还是提供了一个“scp”命令。

    假定你想把本地计算机当前目录下的一个名为“dumb”的文件拷贝到远程服务器www.foobar.com上你的家目录下。而且你在远程服务器上的帐号名为“bilbo”。可以用这个命令:

    scp dumb bilbo@www.foobar.com:.

    把文件拷贝回来用这个命令:

    scp bilbo@www.foobar.com:dumb .

    “scp”调用SSH进行登录,然后拷贝文件,最后调用SSH关闭这个连接。

    如果在你的“~/.ssh/config”文件中已经为www.foobar.com做了这样的配置:

    Host *fbc
    HostName www.foobar.com
    User bilbo
    ForwardAgent yes

    那么你就可以用“fbc”来代替“bilbo@www.foobar.com”,命令就简化为“scp dumb fbc:.”。

    “scp”假定你在远程主机上的家目录为你的工作目录。如果你使用相对目录就要相对于家目录。

    用“scp”命令的“-r”参数允许递归地拷贝目录。“scp”也可以在两个不同的远程主机之间拷贝文件。

    有时候你可能会试图作这样的事:用SSH登录到www.foobar.com上之后,输入命令“scp [local machine]:dumb .”想用它把本地的“dumb”文件拷贝到你当前登录的远程服务器上。这时候你会看到下面的出错信息:

    ssh: secure connection to [local machine] refused

    之所以会出现这样的出错信息是因为你运行的是远程的“scp”命令,它试图登录到在你本地计算机上运行的SSH服务程序……所以最好在本地运行“scp”除非你的本地计算机也运行SSH服务程序。

    用“sftp”拷贝文件
    如果你习惯使用ftp的方式拷贝文件,可以试着用“sftp”。“sftp”建立用SSH加密的安全的FTP连接通道,允许使用标准的ftp命令。还有一个好处就是“sftp”允许你通过“exec”命令运行远程的程序。从2.0.7版以后,图形化的ftp客户软件“gftp”就支持“sftp”。

    如果远程的服务器没有安装sftp服务器软件“sftpserv”,可以把“sftpserv”的可执行文件拷贝到你的远程的家目录中(或者在远程计算机的$PATH环境变量中设置的路径)。“sftp”会自动激活这个服务软件,你没有必要在远程服务器上有什么特殊的权限。

    用“rsync”拷贝文件
    “rsync”是用来拷贝、更新和移动远程和本地文件的一个有用的工具,很容易就可以用“-e ssh”参数和SSH结合起来使用。“rsync”的一个优点就是,不会拷贝全部的文件,只会拷贝本地目录和远程目录中有区别的文件。而且它还使用很高效的压缩算法,这样拷贝的速度就很快。

    用“加密通道”的ftp拷贝文件
    如果你坚持要用传统的FTP客户软件。SSH可以为几乎所有的协议提供“安全通道”。FTP是一个有一点奇怪的协议(例如需要两个端口)而且不同的服务程序和服务程序之间、客户程序和客户程序之间还有一些差别。

    实现“加密通道”的方法是使用“端口转发”。你可以把一个没有用到的本地端口(通常大于1000)设置成转发到一个远程服务器上,然后只要连接本地计算机上的这个端口就行了。有一点复杂是吗?

    其实一个基本的想法就是,转发一个端口,让SSH在后台运行,用下面的命令:

    ssh [user@remote host] -f -L 1234:[remote host]:21 tail -f /etc/motd

    接着运行FTP客户,把它设置到指定的端口:

    lftp -u [username] -p 1234 localhost

    当然,用这种方法很麻烦而且很容易出错。所以最好使用前三种方法。

    用SSH设置“加密通道”
    “加密通道”的基础知识
    SSH的“加密通道”是通过“端口转发”来实现的。你可以在本地端口(没有用到的)和在远程服务器上运行的某个服务的端口之间建立“加密通道”。然后只要连接到本地端口。所有对本地端口的请求都被SSH加密并且转发到远程服务器的端口。当然只有远程服务器上运行SSH服务器软件的时候“加密通道”才能工作。可以用下面命令检查一些远程服务器是否运行SSH服务:

    telnet [full name of remote host] 22

    如果收到这样的出错信息:

    telnet: Unable to connect to remote host: Connection refused

    就说明远程服务器上没有运行SSH服务软件。

    端口转发使用这样的命令语法:

    ssh -f [username@remote host] -L [local port]:[full name of remote host]:[remote port] [some command]

    你不仅可以转发多个端口而且可以在“~/.ssh/config”文件中用“LocalForward”设置经常使用的一些转发端口。

    为POP加上“加密通道”
    你可以用POP协议从服务器上取email。为POP加上“加密通道”可以防止POP的密码被网络监听器(sniffer)监听到。还有一个好处就是SSH的压缩方式可以让邮件传输得更快。

    假定你在pop.foobar.com上有一个POP帐号,你的用户名是“bilbo”你的POP口令是“topsecret”。用来建立SSH“加密通道”的命令是:

    ssh -f -C bilbo@pop.foobar.com -L 1234:pop.foobar.com:110 sleep 5

    (如果要测试,可以把“sleep”的值加到500)。运行这个命令之后会提示你输入POP口令:

    bilbo@pop.foobar.com's password:

    输入口令之后就可以用“telnet”连接到本地的转发端口了。

    telnet localhost 1234

    你会收到远程mail服务器的“READY”消息。

    当然,这个方法要求你手工输入所有的POP命令,这是很不方便的。可以用Fetchmail(参考how to configure Fetchmail)。Secure POP via SSH mini-HOWTO、man fetchmail和在“/usr/doc/fetchmail-[…]”目录下的Fetchmail的FAQ都提供了一些具体的例子。

    请注意IMAP协议使用的是不同的端口:IMAP v2的端口号为143而IMAP v3的端口号为220。

    为X加上“加密通道”
    如果你打算在本地计算机上运行远程SSH服务器上的X程序,那么登录到远程的计算机上,创建一个名为“~/.ssh/environment”的文件并加上这一行:

    XAUTHORITY=/home/[remote user name]/.Xauthority

    (如果在远程主机上你的家目录下不存在“.Xauthority”这个文件,那么当用SSH登录的时候就会自动创建)。

    比如启动一个X程序(xterm)可以这个命令:

    ssh -f -X -l [remote user name] [remote machine] xterm

    这将在远程运行xterm这个程序。其它的X程序也是用相同的方法。

    为linuxconf加上“加密通道”
    Linuxconf是Linux的配置工具,它支持远程管理。Linuxconf的FAQ重说明了如何通过SSH使用linuxconf:

    其命令为:

    remadmin --exec [link_command] linuxconf --guiproto

    如果你想在两台计算机之间用加密的方式传送信息,那么最好用ssh。命令是:

    remadmin --exec ssh -l [account] linuxconf --guiproto

    这是非常有效的而且运行用图形界面管理计算机。

    这种方法需要在客户端安装linuxconf。其它的方法还有直接登录到服务器上用“X11Forwarding”或字符界面运行linuxconf。

    为Webmin加上“加密通道”
    Webmin是一个新的基于浏览器的配置工具。它运行在1000端口。你可以用SSH的“端口转发”对它进行加密:

    ssh -f -l [remote user name] [remote host] -L 1234:[remote host]:10000 tail -f /etc/motd

    把浏览器指向

    http://localhost:1234

    版权说明
    这篇文章翻译和改编自:http://www.mandrakeuser.org/secure/index.html。英文版的版权属于“MandrakeSoft SA and LSTB 1999/2000

    Posted Oct 27 2006, 02:38 PM by wicky with no comments
    Filed under:
  • Exception of type System.OutOfMemoryException was thrown

    http://bbs.hidotnet.com/PrintThread.aspx?PostID=12815   


    Topic: 出现这样的问题 System.OutOfMemoryException
     
    ASP.NET Forums


    Posted by 浪客 on 2005-7-13 2:01 PM

    Exception of type System.OutOfMemoryException was thrown.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.OutOfMemoryException: Exception of type System.OutOfMemoryException was thrown.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [OutOfMemoryException: Exception of type System.OutOfMemoryException was thrown.] 

    Posted by venjiang on 2005-7-13 10:23 PM
    正好在看RSS列表时,看到一篇这样的资料,不知对你有无帮助.
    ------------------------------------------------------------------------------------------

    ASP.NET中的OutOfMemoryException

    在博客园看到了一位园友写的文章《如何处理OutOfMemoryException异常?》,于是想和大家交流一下ASP.NET中出现OutOfMemoryException的问题。

    实际上,在ASP.NET Web服务器上,ASP.NET所能够用到的内存,通常不会等同于所有的内存数量。在machine.config配置文件中,<processModel>中有一个属性“memoryLimit”,这个属性的值是一个百分值,默认为“60”,即指定了ASP.NET进程(在任务管理器中大家就可以看到ASP.NET的进程,IIS5中为aspnet_wpIIS6中为w3wp)能够使用所有物理内存的60%。当ASP.NET使用的内存量超过这个限额时,IIS会开始自动回收(recycle)进程,即创建一个新的进程去负责应付Http请求,而将旧进程所占用的内存回收。

    当我们有一台很大内存的服务器时,“memoryLimit”这个值是需要进行适当的调整的。比如我们准备了一台chemas-microsoft-comSurprisefficeTongue Tiedmarttags" />Tongue Tiedt="on">4G内存的服务器,那么Tongue Tiedt="on">4G×60%Tongue Tiedt="on">2.4G。但是,对于Win32操作系统,一个进程所能占用的所有内存空间只有Tongue Tiedt="on">2G。当ASP.NET进程占用的内存开始达到Tongue Tiedt="on">2G时,由于它并没有达到Tongue Tiedt="on">2.4G回收阈值,所以IIS不会启动recycle进程操作,但是由于Win32的限制,实际上已经不能给这个进程分配更多的内存了,于是,OutOfMemoryException就很可能会被抛出了。为了避免这样的情况,我们就必须将“memoryLimit”适当调小,以让IIS更早的进行进程回收。

    微软推荐的ASP.NET进程占用内存是不超过60%,并最好使计算出的实际值不超过Tongue Tiedt="on">800M。就是说,对于一台Tongue Tiedt="on">4G内存的服务器,最好将“memoryLimit”属性设置成“20”。设置一个适当的回收阈值,让IIS适时的进行进程回收,对于保证整个服务器的稳定运行,避免OutOfMemoryException是非常重要的。

    IIS6中,ASP.NET进程的回收阈值不再由配置节中的“memoryLimit”属性决定,而是由IIS管理器中的应用程序池配置中的设置决定。

    但是,即使正确设置了这些配置,也不能保证完全避免OutOfMemoryException的发生,原因可能是多样而复杂的,比如内存回收操作可能耗时太多等等。开发人员要注意的,就是在代码中时刻牢记不要无谓的使用和浪费内存。:)

    如果你有一台大内存的服务器,同时对Win32操作系统中对于进程最高使用Tongue Tiedt="on">2G内存的限制很郁闷,可选的解决方法有两个:
    1
    、使用/3GB模式启动计算机,方法参加文后的链接
    2
    、使用Windows Server 2003 64bits Edition

    资源链接:
    Microsoft IIS 5.0 Process Recycling Tool
    ,使IIS5具有类似IIS6的进程监视回收功能
    Microsoft KB: Information on Application Use of 4GT RAM Tuning
    Microsoft KB: 4 GB RAM 调试功能和物理地址扩展开关介绍

     by kaneboy


    Posted Oct 26 2006, 04:35 PM by wicky with 1 comment(s)
    Filed under:
  • PRB: ThreadAbortException Occurs If You Use Response.End, Response.Redirect, or Server.Transfer

    http://support.microsoft.com/kb/312629/EN-US/

    SYMPTOMS

    loadTOCNode(1, 'symptoms');
    If you use the Response.End, Response.Redirect, or Server.Transfer method, a ThreadAbortException exception occurs. You can use a try-catch statement to catch this exception.

    CAUSE

    loadTOCNode(1, 'cause');
    The Response.End method ends the page execution and shifts the execution to the Application_EndRequest event in the application's event pipeline. The line of code that follows Response.End is not executed.

    This problem occurs in the Response.Redirect and Server.Transfer methods because both methods call Response.End internally.

    RESOLUTION

    loadTOCNode(1, 'resolution');
    To work around this problem, use one of the following methods:
    For Response.End, call the HttpContext.Current.ApplicationInstance.CompleteRequest method instead of Response.End to bypass the code execution to the Application_EndRequest event.
    For Response.Redirect, use an overload, Response.Redirect(String url, bool endResponse) that passes false for the endResponse parameter to suppress the internal call to Response.End. For example:
      Response.Redirect ("nextpage.aspx", false);
    						
    If you use this workaround, the code that follows Response.Redirect is executed.
    For Server.Transfer, use the Server.Execute method instead.

    STATUS

    loadTOCNode(1, 'status');
    This behavior is by design.
     
    Posted Oct 25 2006, 12:00 PM by wicky with no comments
    Filed under:
  • IE 7.0 Released

     
    Microsoft has released the final build of IE7 today to customers, with the company expected to push the build by automatic updates on 1st November.

    Full English Links @ Microsoft:

    Windows XP SP2 Edition
    Windows Server 2003 32-bit Edition
    Windows XP & Windows Server 2003 x64 Edition
    Windows Server 2003 ia64 Edition
    Posted Oct 19 2006, 08:25 AM by wicky with no comments
    Filed under:
  • 微软商用vista中文版11月末在华发布

    作者: CNET科技资讯网
    CNETNews.com.cn 2006-10-18 09:35:04 AM
    http://www.cnetnews.com.cn/news/softwares/story/0,3800055189,39539421,00.htm

    CNET科技资讯网 10月18日 北京报道(文/蒋湘辉):几经延期的下一代微软桌面操作系统Windows Vista终于确定了正式发布时间——2006年11月末,或许微软是为了给久等之后的人们一个惊喜,该时间比原来承诺的12月初还要早些。而同一天发布的产品还有2007 Office系统和Exchange Server 2007。

    微软公司在过去几年研发总投入超过200亿美元的这些重量级软件,将集中从11月底和12月初这一时间段在不同国家巡回发布不同的语言版本。据悉,将于11月末在北京隆重登场的2007 Office系统中文版将包含面向商业和个人同用户的7个版本(基础版、家用及学生版、小型商务版、标准版、专业版、专业增强版和企业版),而Windows Vista则只推出面向商业用户的版本,面向个人用户的Vista仍将于2007年1月正式发布。

    据微软(中国)公司的相关人士透露,用户在11月初就可以预订2007 Office系统中文版的产品,而微软也将把Windows Vista交付OEM厂商。因为微软Windows Vista的RTM (Release To Manufacturing)版本预计10月底即可面世,并将最先出台英文版,其他语言的RTM版本预计随后一周发布。RTM版本与正式版本的代码是一致的,只是程序代码开发完成之后,要将母片送到工厂大量压片并包装。

    微软的客户端操作系统和Office系列软件历来是微软公司的核心支柱产品,也是最大的两颗摇钱树。按照微软公布的2006年财报,微软在2006财年(2005年7月~2006年6月)的总销售额为443亿美元,其中:桌面操作系统(Windows Client)部门收入为132亿美元,运营利润高达102亿美元;以Office系统为核心“信息工作者(Information Worker)”部门销售额为117亿美元,运营利润也超过82亿美元。而Exchange Server 2007所在的“服务器和工具软件(Server&Tools)”部门销售额为115亿美元,运营利润为43亿美元。据悉,微软在今年7月开始的2007财年,为了更好地推进2007 Office系统倡导的“UC&C(统一通信与协作)”战略,微软将Exchange Server产品线划到Office所在的信息工作者部门旗下。

    Windows Vista是微软公司宣称的继上世纪发布Windows 95以来最重要的一个桌面操作系统版本,而2007 Office系统则是微软今年开始倡导的“全员就绪People Ready”理念的重要基石(全员就绪是此前很多公司提倡的“随需应变”理念的一种升华,核心是发挥企业每一位员工的最高效率,得知自身需求,做出合理决策)。10月17日,负责微软全球IW部门的微软副总裁Chris Capossela在北京表示,“2007 Office系统更加强调团队的合作,它可帮助企业实现顺畅的沟通,借助可视化及其它设备可增强企业员工对信息的管理和数据挖掘能力,它还可以帮助用户简化流程,实现安全的内容管理。”

    据分析,Windows Vista和2007 Office的推出将为整个IT产业注入一剂强心剂,它们不仅可以吸引每年高达两亿新增PC的用户眼球,也将加速现有10多亿老PC用户的升级换代,因为能够顺畅运行两大软件的PC所需内存推荐为1GB或以上,这对相关硬件、应用软件和服务厂商都将产生重大影响。

     

    Posted Oct 18 2006, 09:33 PM by wicky with no comments
    Filed under:
  • How to deploy Microsoft Windows Preinstallation Environment from an RIS server by using PXE-enabled clients

    http://support.microsoft.com/?kbid=304992

    SUMMARY

    loadTOCNode(1, 'summary');
    This article describes how to deploy the Microsoft Windows Preinstallation Environment (Windows PE) from a Remote Installation Services (RIS) server for a Pre-Boot Execution Environment (PXE) start.

    MORE INFORMATION

    loadTOCNode(1, 'moreinformation');
    There are two methods that you can use to deploy Windows PE from a RIS server. The first method uses a RAM disk device to deploy Windows PE from the RIS server. The second method deploys a Windows PE image from a Microsoft Windows XP or Microsoft Windows Server 2003 CD-based image. You must use this second method only if you have older versions of Windows PE or if you do not have a Windows Server 2003-based RIS server. This second method opens many file handles from the RIS server. Therefore, this method reduces the performance of the RIS server when you start multiple instances of Windows PE. You may also experience time-out errors.

    For more information about how to deploy Windows PE from RIS Servers, see the latest Winpe.chm file. This file is included with the Windows PE CD and with the OEM Preinstallation Kit (OPK) CD.

    Before you use the methods that are described in this article, you must make sure that you have the following items:
    A customized Windows PE International Organization for Standardization (ISO) image that is created from the Windows PE CD or from the OEM Preinstallation Kit (OPK) CD.
    A RIS server that is running Windows Server 2003 with Service Pack 1 (SP1).
    A Windows PE CD or an OEM Preinstallation Kit (OPK) CD.

    Method 1: Deploy Windows PE from a RIS server by using a RAM disk

    loadTOCNode(2, 'moreinformation');
    1. On the RIS server, locate the \RemoteInstall\Setup\Language\Images folder.
    2. Create a subfolder for Windows PE. For example, type the following at a command prompt:
    drive:\Cd \RemoteInstall\Setup\English\Images md winpe
    Note In this step, drive is the placeholder of the hard disk drive on which RIS is installed. Language is the language of the Windows PE image.
    3. Create a subfolder in the \Windows PE folder that is named Platform, where platform is i386 or amd64. For example, type the following command at the command prompt: md winpe\i386
    4. Copy the customized Windows PE .iso image file that you created earlier to the Windows PE\Platform folder, where platform is i386 or amd64. For example, type the following command at the command prompt:
    copy drive:\Work\Winpex86.iso drive 1:\RemoteInstall\Setup\English\Images\Winpe\i386
    Note drive is the placeholder of the hard disk that contains the Windows PE image. Also, drive 1 is a placeholder for the hard disk partition on which RIS is installed.
    5. Create a subfolder in the \Windows PE\Platform folder that is named Templates. For example, type the following command at the command prompt:
    md winpe\i386\templates
    6. Locate the Platform folder of the Windows PE image, and then copy Ntdetect.com and Startrom.com to the Windows PE\Platform\Templates folder. For example, type the following commands at the command prompt:
    drive:\ cd \winpe\i386 copy ntdetect.com
    drive 1:\RemoteInstall\Setup\English\Images\winpe\i386\templates copy startrom.com
    drive 1:\RemoteInstall\Setup\English\Images\winpe\i386\templates


    Note In this step, drive is the placeholder of the hard disk that contains the Windows PE image and drive 1 is a placeholder for the hard disk partition on which RIS is installed.
    7. Copy the \Platform\Setupldr.exe (not Setupldr.bin) file from the Windows PE image to the \Windows PE\platform\templates folder, and then rename Setupldr.exe to Ntldr. For example, run the following command at the command prompt:
    copy setupldr.exe drive 1:\RemoteInstall\Setup\English\Images\winpe\i386\templates\ntldr
    .

    Note In this step, drive 1 is a placeholder for the hard disk partition on which RIS is installed.
    8. Create a text file that is named Winnt.sif in the \Windows PE\Platform\Templates folder by using the following text.
    [SetupData]
    BootDevice = "ramdisk(0)"
    BootPath = "\platform\System32\"
    OsLoadOptions = "/noguiboot /fastdetect /minint /rdexportascd /rdpath=%INSTALLPATH%\%MACHINETYPE%\<bootimage>"
    
    Architecture = "platform" 
     
    [RemoteInstall]
    Repartition = No
     
    [OSChooser]
    Description = "brief description"
    Help = "longer description"
    LaunchFile = "%INSTALLPATH%\%MACHINETYPE%\templates\startrom.com"
    ImageType = Flat
    Version = "5.2 (0)"
    
    9. Start a RIS client, and then select the operating system image that you created.
    Notes
    RAM disk method supports only x86 and x64-based Windows PE ISO images. For Itanium (IA-64)-based Windows PE ISO images use Method 2.
    You can put the i386 and amd64 folders within the same folder on a RIS server. For example, you can create the following folder structure:
    \RemoteInstall\Setup\English\Images\Winpe\i386 \RemoteInstall\Setup\English\Images\Winpe\Amd64
    You can give the Winnt.sif file any name that you want as long as the file name extension is .sif.
    The "Repartition = No" entry in the Winnt.sif file avoids a warning from the Client Installation Wizard (OSChooser) about the disk being erased.
    The text for the "Description" and "Help" entries can be any information that you want to include.
    The "LaunchFile" and "ImageType" entries must not change.
    Restart the client, and then go into PXE startup. After you log on, select the Maintenance and Troubleshooting option in the Main menu. "Windows PE in RAMDisk," or whatever other description exists in the .sif file, appears as an option. Select this option, and then press ENTER.

    The computer starts Windows PE by using the RAM disk.

    Method 2: Deploy Windows PE from RIS server in legacy flat method

    loadTOCNode(2, 'moreinformation');
    1. On the RIS server, type the following command at a command prompt:
    RISetup.exe –add
    When you are prompted for a source, point RISetup to the Windows operating system CD that you want to use. The choice of the Windows operating system depends on the version of Windows PE that you add to the RIS server. For Windows PE 2004, use Windows XP Professional Service Pack 2. For Windows PE 2005, use Windows Server 2003 Standard Edition Service Pack 1.
    2. Browse the location where RISetup installed the image. For example, the location may resemble the following:
    \\Server_name\Share_name\REMINST\Setup\Language\Images
    Note In this step, the Server_name placeholder represents the RIS server name. The Share_name placeholder represents the name of the shared folder that contains the image. The Language placeholder represents the language version of the image.
    3. Open the platform subfolder in the image that you created, where platform represents i386, amd64, or IA-64.
    4. Open the Platform folder on the CD or network share that contains Windows PE files, where platform represents i386, amd64, or IA-64.
    5. Copy the contents of the Windows PE Platform folder to the platform folder of the image that you just opened.
    6. When you are prompted to overwrite the files, click Yes to all.
    7. Open the