afunms

          My Software,My Dream—Forge a more perfect NMS product.

          test SSH

          package com.test;

          import de.mud.ssh.*
          ;


          /**
           * This is an example for using the SshWrapper class. Note that the
           * password here is in plaintext, so do not make this .class file
           * available with your password inside it.
           
          */

          public class SshWrapperExample 
          {
              
          public static void
           main(String args[]) 
              
          {
               SshWrapper ssh 
          = new
           SshWrapper();
               
          try
           
               
          {
                    
          byte[] buffer = new byte[256
          ];
                    ssh.connect(
          "192.168.2.155"23
          );
                    ssh.login(
          "root""root"
          );
                    ssh.setPrompt(
          "#"
          );
                    ssh.send(
          "sar 1 3"
          );
                    ssh.read(buffer);
                    System.out.println(
          new
           String(buffer));
               }
           
               
          catch
           (java.io.IOException e) 
               
          {
                    e.printStackTrace();
               }

              }

          }

          posted on 2008-01-30 15:50 afunms 閱讀(251) 評論(1)  編輯  收藏

          Feedback

          # re: test SSH 2008-05-29 19:50 趙志華

          您好


          這個代碼可以ssh到網元馬?

          我測試了好像不可以阿  回復  更多評論   



          只有注冊用戶登錄后才能發表評論。


          網站導航:
           

          My Links

          News

          留言簿(18)

          隨筆檔案

          相冊

          搜索

          最新評論

          閱讀排行榜

          主站蜘蛛池模板: 水城县| 福建省| 监利县| 疏附县| 武穴市| 清苑县| 大姚县| 廊坊市| 金山区| 全州县| 安多县| 仲巴县| 五常市| 涡阳县| 乳山市| 珠海市| 平远县| 南安市| 章丘市| 山西省| 宜兰市| 楚雄市| 巨野县| 西峡县| 永福县| 乌拉特后旗| 巴中市| 襄城县| 海兴县| 封开县| 图木舒克市| 鄂托克前旗| 上饶县| 兴仁县| 突泉县| 常州市| 长寿区| 营口市| 来安县| 蕲春县| 湖北省|