Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I enable passive mode while using JSch as SFTP client?

I'm using JSch as SFTP client and now I need to enable passive mode because of some limitation of security.

But I can not found a way to enable passive mode.

Can somebody tell me how to do this?

like image 759
Sky Avatar asked Nov 29 '22 18:11

Sky


2 Answers

"Passive mode" is a specialty of the FTP protocol.

In normal FTP mode for each individual file the client listens on a port and the server has to connect to this. As many firewalls support only outgoing connections, there was added the passive mode - here the client connects to the server for the individual files.

SFTP is a totally independent protocol from FTP - it also supports file transfer over a network, but this is already the end of the similarities. Everything (both commands and data) is transferred in the same SFTP channel, which in turn usually (and certainly if using JSch), is part of an SSH connection, which is transported over TCP. This single TCP connection is always started by the client, thus there should be no problem with firewalls, if they don't block SSH completely.

If you have a problem with your "limitation of security" (whatever this it), it certainly does not depend on SFTP modes here. If you add the necessary information to your question, we can maybe help you here.

like image 191
Paŭlo Ebermann Avatar answered Dec 30 '22 11:12

Paŭlo Ebermann


SFTP protocol has no passive mode - it runs everything (commands and data) over one established connection.

like image 21
Eugene Mayevski 'Callback Avatar answered Dec 30 '22 11:12

Eugene Mayevski 'Callback