Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to copy a file from remote machine(which is using Windows OS) to my machine(It also uses Windows OS) using ssh in java.So i used JSch sample code exec to do this work.In this i gave scp command to copy files.but i always get -1 as returned value.Even i used ScpFrom sample code which also didnt work in my case.In some case It returned

Unable to execute command or shell on remote system: Failed to Execute process.
exit-status: -1

other cases (i.e) used different slashes or path and it returned only

exit-status: -1

scp command used

scp -f user@ipadress:\user\folder\file.txt \user1\folder2

user-username of remotemachine

i even changed the slashes to forward one or with double slash.All things failed.

does freesshd server supports SCP?

Could any one help me in figure out the problem. Thanks in advance.

share|improve this question

migrated from Dec 21 '12 at 12:35

This question came from our site for professional and enthusiast programmers.

Your Windows machines got something installed to support scp ? – Aviram Segal Dec 21 '12 at 11:01
Have you tried reading the output from executing the jsch command? Have a look here for an example. More logging will help debug this. – Martin Foot Dec 21 '12 at 11:02
@AviramSegal i have installed freesshd server to support scp – user1771402 Dec 21 '12 at 11:17
@MartinFoot i tried it.but no output is coming except exit status -1 – user1771402 Dec 21 '12 at 11:18
Have you tried to run this command in terminal? – tcb Dec 21 '12 at 11:23

You must log in to answer this question.

Browse other questions tagged .