Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2004

Tip: Looking for answers? Try searching our database.

Classes SSH-SCP for Java

Thread view: 
Xavier - 27 Oct 2004 14:43 GMT
Hello,

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

Thanks

Xavier
Rogan Dawes - 27 Oct 2004 17:39 GMT
> Hello,
>
[quoted text clipped - 5 lines]
>
> Xavier

Google for "Java ssh2 scp"?

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

Rogan
Signature

Rogan Dawes

*ALL* messages to discard@dawes.za.net will be dropped, and added
to my blacklist. Please respond to "nntp AT dawes DOT za DOT net"

Bryan Castillo - 28 Oct 2004 04:56 GMT
> > Hello,
> >
[quoted text clipped - 10 lines]
> 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
John C. Bollinger - 27 Oct 2004 17:48 GMT
> I am searching for classes to use SCP (server use SSH2) in my Java
> application.
> Any idea ? Any link ?

Did you try Google?

http://www.google.com/search?hl=en&q=ssh+java&btnG=Google+Search

I can't recommend any particular solution, but it looks like there are
quite a few available.

John Bollinger
jobollin@indiana.edu
Alex Hunsley - 27 Oct 2004 23:23 GMT
> 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
Xavier - 29 Oct 2004 10:24 GMT
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
Michael Borgwardt - 29 Oct 2004 10:43 GMT
> 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.
Alex Hunsley - 04 Nov 2004 12:59 GMT
> Hi,
>
[quoted text clipped - 5 lines]
>
> 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
Xavier - 05 Nov 2004 14:48 GMT
> 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
Michael Borgwardt - 05 Nov 2004 15:00 GMT
>>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/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.