SSHWrapperExample Not working...

  • Nobody/Anonymous

    The SSHWrapperExample is not working for me... i get some print statements like :
    remotemajor 1
    remoteminor 99

    nothing else.

    Can anyone paste some code that works for ssh...


    • Marcus Meissner

      Marcus Meissner - 2003-06-05

      MY tries were so far unsucessful, sorry.

      The SSHWrapper is not really finished yet,
      there is one or more bugs still in it.

      Ciao, Marcus

    • Nobody/Anonymous


      Can you post any code that makes use of your ssh apis ?
      i.e does ssh work at all ?


    • Nobody/Anonymous

      Hi Folks,

      Here is a fix for this issue.

      The user and password are not getting set before login.
      In, override's login method so the user and password get set.

      Add the following method to
      public void login(String user, String pwd) throws IOException {
          waitfor(getPrompt()); // throw output away

      The class SshWrapperExample in should be like so: 
      public class SshWrapperExample {
        public static void main(String args[]) {
          SshWrapper ssh = new SshWrapper();
          try {
            byte[] buffer = new byte[256];
            // Remote host name or ip address is passed as an argument
            ssh.connect(args[0], 22);
            ssh.login("marcus", "xxxxx");
            System.out.println("after login");

            ssh.send("ls -l");
            System.out.println(new String(buffer));
          } catch ( e) {

    • Nobody/Anonymous

      Hi friends ,
          its me Anu. i need a coding for connecting a java server and a unix server.
      By connecting java and unix only  futher i monitor the process going on in unix.
        if u know please sent me codings for that connectivity .
      my mail id is

                                           Thank u


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks