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 閱讀(252) 評論(1)  編輯  收藏

          Feedback

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

          您好


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

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



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


          網站導航:
           

          My Links

          News

          留言簿(18)

          隨筆檔案

          相冊

          搜索

          最新評論

          閱讀排行榜

          主站蜘蛛池模板: 农安县| 丰镇市| 沭阳县| 顺平县| 云林县| 鹤庆县| 若尔盖县| 无锡市| 万全县| 卢氏县| 福建省| 连州市| 扶风县| 潍坊市| 颍上县| 福鼎市| 贞丰县| 琼海市| 张家川| 塔河县| 颍上县| 虹口区| 分宜县| 拜泉县| 南开区| 沙河市| 兴安盟| 华亭县| 迭部县| 昭平县| 利辛县| 顺义区| 衡阳市| 临沂市| 合水县| 平湖市| 德阳市| 永年县| 宁南县| 新巴尔虎左旗| 锡林浩特市|