Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't SFTP have an active/passive mode like FTP

Tags:

sftp

ftp

As I understand it, active and passive mode in FTP changes the port on which commands and data are sent from the client to the server which can be useful where firewalls are concerned. I think I'm also right in saying that SFTP doesn't have the same concept - but I'm not clear what nuances of the SFTP protocol make it unnecessary/undesirable to mimic that same pattern that exists in FTP.

like image 531
David Avatar asked Jun 08 '18 08:06

David


People also ask

Does SFTP have active and passive mode?

1 Answer. SFTP doesn't use passive mode - that's for FTP or FTPS (you might be talking about FTPS). Hundreds of connections from a client may not work as there is usually a limit to the number of network connections you can open on a client machine.

What is SFTP passive mode?

“Passive mode” means that the server will be “passive” and accept data connections from the client, instead of requiring the client be able to accept connections back from the server. (This unusual behavior of server-to-client connections is unique to the FTP protocol.)

What is the difference between active and passive SFTP?

In an active mode connection, when the client makes the initial connection and sends PORT, the server initiates the second connection back. In a passive connection, the client connects and sends the PASV command, which functions as a request for a port number to connect to.

Does FTP work in active or passive mode?

In Passive Mode, the FTP server waits for the FTP client to send it a port and IP address to connect to. In Active mode, the server assigns a port and the IP address will be the same as the FTP client making the request.


1 Answers

Active/passive mode distinction in FTP protocol is needed, because in FTP, there's a separate transfer channel/connection for file transfers. And in different network setups, a different mode might be needed (though nowadays, mostly passive mode it used).

It's not useful where firewalls are concerned, it's a problem where firewalls are concerned. This concept of a separate connection on a separate port was probably not a good idea, as I do not think that this model was ever repeated again in any other similar protocol. Wikipedia FTP article mentions that FTP was designed this way because originally it was not intended to operate over TCP/IP.

In SFTP, there's nothing like that. All happens within one connection. So there are no problems "where firewalls are concerned".

like image 122
Martin Prikryl Avatar answered Sep 19 '22 19:09

Martin Prikryl