How can I connect to an SSH server in Java? I don't need/want a shell. I just want to connect to the SSH server and get the content of, say, file.txt
. How can I do that?
views:
102answers:
5
+3
A:
Java doesn't support that natively, but you can use a library like JSch to do it
Michael Mrozek
2010-06-18 17:21:42
A:
You must use a third-party library - JSch is one of them. Google with "Java ssh
" and you will get plenty of other options.
Petar Minchev
2010-06-18 17:22:25
A:
http://www.ganymed.ethz.ch/ssh2/ implements a ssh2 client in Java. I use it for port forwarding.
Thorbjørn Ravn Andersen
2010-06-18 17:34:15