connect to SFTP using java

后端 未结 6 1703
野趣味
野趣味 2021-01-07 09:33

I need help with connection to SFTP server? Does anybody have working code?

I found something like this

package test.JSch;

import com.jcraft.jsch.*;         


        
6条回答
  •  -上瘾入骨i
    2021-01-07 10:31

    Here is an earlier question on Stackoverflow, for which the accepted answer suggests using JSch library.

    How to retrieve a file from a server via SFTP?

    I see that you have tried to connect via JSch and got an error.

    I would suggest that the first thing is to check if you can connect to the sftp machine from the client (same machine on which you are testing your program), using a standard sftp client like Filezilla on Windows OR just the sftp command on a terminal in *nix systems.

提交回复
热议问题