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

狂风中的少年 提交于 2020-01-11 06:03:19

问题


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?


回答1:


"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.




回答2:


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



来源:https://stackoverflow.com/questions/5881589/how-can-i-enable-passive-mode-while-using-jsch-as-sftp-client

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!