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

后端 未结 2 2011
旧巷少年郎
旧巷少年郎 2021-01-13 21:41

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 passiv

相关标签:
2条回答
  • 2021-01-13 22:26

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

    0 讨论(0)
  • 2021-01-13 22:42

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

    0 讨论(0)
提交回复
热议问题