Classes SSH-SCP for Java

Discussion in 'Java' started by Xavier, Oct 27, 2004.

  1. Xavier

    Xavier Guest

    Hello,

    I am searching for classes to use SCP (server use SSH2) in my Java
    application.
    Any idea ? Any link ?

    Thanks

    Xavier
    Xavier, Oct 27, 2004
    #1
    1. Advertising

  2. Xavier

    Rogan Dawes Guest

    Xavier wrote:

    > Hello,
    >
    > I am searching for classes to use SCP (server use SSH2) in my Java
    > application.
    > Any idea ? Any link ?
    >
    > Thanks
    >
    > Xavier
    >
    >

    Google for "Java ssh2 scp"?

    Go on, just try it! Hint: The 5th link pointing to linuxmafia is the one
    you want. . . . .

    Rogan
    --
    Rogan Dawes

    *ALL* messages to will be dropped, and added
    to my blacklist. Please respond to "nntp AT dawes DOT za DOT net"
    Rogan Dawes, Oct 27, 2004
    #2
    1. Advertising

  3. John C. Bollinger, Oct 27, 2004
    #3
  4. Xavier

    Alex Hunsley Guest

    Xavier wrote:
    > Hello,
    >
    > I am searching for classes to use SCP (server use SSH2) in my Java
    > application.
    > Any idea ?


    Learn how to use this really useful site called "Google".

    > Any link ?


    www.google.com

    >
    > Thanks
    >
    > Xavier
    >
    >
    Alex Hunsley, Oct 27, 2004
    #4
  5. Rogan Dawes <> wrote in message news:<cloj0c$2iu$>...
    > Xavier wrote:
    >
    > > Hello,
    > >
    > > I am searching for classes to use SCP (server use SSH2) in my Java
    > > application.
    > > Any idea ? Any link ?
    > >
    > > Thanks
    > >
    > > Xavier
    > >
    > >

    > Google for "Java ssh2 scp"?
    >
    > Go on, just try it! Hint: The 5th link pointing to linuxmafia is the one
    > you want. . . . .
    >


    Can anyone out there comment on some of the ssh packages for java?
    Have you tried any of them and were you happy with them? I tried
    using jsch, it is one of the optional packages that ant 1.6+ uses for
    its ssh tasks. I was trying to figure out how to execute commands via
    ssh. The jsch packages seems like its built more for tunnelling X or
    something..... It launches threads for input, error and output
    streams and you have to wait for them to complete and there is no
    event notification (like a listener) to tell you when IO is done.

    I looked at the ant 1.6.2 code and it used a loop with a half-second
    sleep.

    [Snippet from ant.taskdefs.optional.ssh.SSHExec.java]

    // execute the command
    Session session = openSession();
    session.setTimeout((int) maxwait);
    final ChannelExec channel = (ChannelExec)
    session.openChannel("exec");
    channel.setCommand(command);
    channel.setOutputStream(tee);
    channel.setExtOutputStream(tee);
    channel.connect();

    // wait for it to finish
    thread =
    new Thread() {
    public void run() {
    while (!channel.isEOF()) {
    if (thread == null) {
    return;
    }
    try {
    sleep(500);
    } catch (Exception e) {
    // ignored
    }
    }
    }
    };

    thread.start();
    thread.join(maxwait);

    [end code snippet]

    I thought it was a little messy and clumsy to have to code a sleep in
    there to wait for IO completion of the ssh exec task.


    I also looked at SSHTools and the API seemed very complicated.
    Perhaps I'll take a look at it again, but I really didn't want to
    write code to check keystores myself.



    > Rogan
    Bryan Castillo, Oct 28, 2004
    #5
  6. Xavier

    Xavier Guest

    Hi,

    > Learn how to use this really useful site called "Google".


    Oh, yes ! How if I had not thought of it !

    > www.google.com


    Wouldn't this be ... "google" ?

    ......

    If I post the question, it's that I have already searched on the web !!

    Xavier
    Xavier, Oct 29, 2004
    #6
  7. Xavier wrote:
    > If I post the question, it's that I have already searched on the web !!


    If we answer "Try Google" it's that we cannot imagine someone having alread
    searched on the web and not having found something. Which means that there
    are two possible explanations:

    - You are very bad at using search engines, in which case "Learn to use Google"
    is the best solution to the problem.

    - The SSH implementations that can so easily be found are not useable to you
    for some reason - in which case you should have TOLD us that reason so that
    we can help you find one that better matches your criteria.
    Michael Borgwardt, Oct 29, 2004
    #7
  8. Xavier

    Alex Hunsley Guest

    Xavier wrote:
    > Hi,
    >
    >
    >>Learn how to use this really useful site called "Google".

    >
    >
    > Oh, yes ! How if I had not thought of it !
    >
    >
    >>www.google.com

    >
    >
    > Wouldn't this be ... "google" ?


    Yes, it is google, that's what I said wasn't it?

    >
    > .....
    >
    > If I post the question, it's that I have already searched on the web !!
    >
    > Xavier


    Then you really do need to learn how to use a search engine. Google
    returned lots of googd hits when I searched for a java ssh implementation.

    alex
    Alex Hunsley, Nov 4, 2004
    #8
  9. Xavier

    Xavier Guest

    > I am searching for classes to use SCP (server use SSH2) in my Java
    > application.
    > Any idea ? Any link ?


    OK, precisions : I need SSH2 implementation .... All I have found on the WEB
    are implenting SSH1.

    Xavier
    Xavier, Nov 5, 2004
    #9
  10. Xavier wrote:

    >>I am searching for classes to use SCP (server use SSH2) in my Java
    >>application.
    >>Any idea ? Any link ?

    >
    >
    > OK, precisions : I need SSH2 implementation .... All I have found on the WEB
    > are implenting SSH1.


    http://www.google.com/search?q=java ssh2
    Seems to give one as the first result, namely
    http://www.jcraft.com/jsch/
    Michael Borgwardt, Nov 5, 2004
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Epler
    Replies:
    0
    Views:
    555
    Jeff Epler
    Jul 24, 2005
  2. krabhi
    Replies:
    1
    Views:
    9,291
    Marco Meschieri
    Aug 9, 2006
  3. loial
    Replies:
    0
    Views:
    396
    loial
    Feb 3, 2009
  4. Une Bévue
    Replies:
    0
    Views:
    379
    Une Bévue
    Jul 22, 2008
  5. Une Bévue
    Replies:
    0
    Views:
    790
    Une Bévue
    Mar 22, 2012
Loading...

Share This Page