Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 3
    You could just use public key authentication for your SSH connections. See for example stackoverflow.com/questions/7260/… . Commented Jun 9, 2014 at 6:52
  • No,I can't do that.Bcos I would like to automate it.And I need some way to copy the public key to remote system without user intervention,I mean through java code.Asking the password for very first time is fine.But it should not ask every time I run the code. Commented Jun 9, 2014 at 10:47
  • Yeah Thank you.I implemented this using Jsch library with sftp channel.And for the very first time I'll be having the credentials of the remote system so I don't have any issues in login.And then as suggested by @SamiLaine I copied my public key and my actual files(the files which I actually wanted to copy) to remote system.So for the next time while copying it didn't asked for any password. :) Commented Jun 9, 2014 at 12:31
  • i need to transfer .csv files from linux machine to windows machine.i used jsch i am able to read the data in my console.i want the complete file to be in my local machine. is there an API or how would i do it? Commented Aug 21, 2014 at 14:28