SFTP Upload in “ASCII” Mode

后端 未结 3 1737
-上瘾入骨i
-上瘾入骨i 2021-01-24 08:49

I have a simple text file that I am uploading from a windows platform to a Unix server using SFTP (Client: FireFTP). I have noticed that when uploading using SFTP rather than pl

相关标签:
3条回答
  • 2021-01-24 09:15

    SFTP protocol has several versions (1-6) with version 3 being the most popular. ASCII mode has been added in version 4 of the protocol.

    In our SecureBlackbox product we emulate ASCII mode if connection has been negotiated with version 3 or lower of the protocol, but such emulation requires that you know the OS (or line ending) of the remote server. Also ASCII mode makes it harder to implement so-called pipelining of SFTP requests, the feature, that makes SFTP transfer much faster.

    0 讨论(0)
  • 2021-01-24 09:17

    FTP != SFTP. This is most important thing you should note.

    And ASCII mode is just a ancient nonsense. There is no such thing in quite modern SFTP, which just transfer bytes as they are (there is no reason to do it other way).

    0 讨论(0)
  • 2021-01-24 09:27

    The Firezilla wiki has a page on technical specifications. The most widely implemented version of the SFTP spec is version 3 draft 2. Notably, the Openssh SFTP client and server implement that version of the spec.

    Version 3 of the SFTP protocol doesn't have a feature equivalent to FTP's ASCII transfer mode. It always transfers files verbatim.

    Later versions of the SFTP protocol support transfer modes that convert line terminator characters. Hypothetically, you could find a client and server that supports the feature.

    Is this a matter of what SFTP protocol version the client is using...?

    I don't know FireFTP's capabilities. But the OpenSSH SFTP server doesn't support an ASCII-like transfer mode.

    is it simply "accepted" that when transferring a file from Windows -> Unix that you will have the additional CR (^M) leftover...

    There are various ways of dealing with the issue. There are programs to convert from one format to another. Some programs that read text files will tolerate line terminators in either format.

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