Exchange Files with SCP Server using Linux/BSD SCP command

TurboFTP Server can act as an SCP server to provide SCP (Secure copy) service over the SSH2 layer. Because of the same underlying secure layer, SCP offers the same level of security as SFTP over SSH2. In terms of file transfer, SCP is technically faster because it requires no repetitive confirmation of data blocks like in SFTP. Also, SCP is ideal to be used in the script for batch file transfer, where it is more straightforward than SFTP.

Turbo FTP Server can run as an SCP server for Windows while supporting the exact syntax of Linux/Unix SCP command with some subtle differences.

For example:

# Copy the file "myfile.txt" from a remote host to the local host
$ scp joe@remotehost.com:myfile.txt /some/local/directory

# Copy the file "myfile.txt" from the local host to a remote host
$ scp myfile.txt joe@remotehost.com:/some/remote/directory/

# Copy the directory "dir1" from the local host to a remote host's directory "dir"
$ scp -r dir1 joe@remotehost.com:/some/remote/dir

Subtle differences of SCP syntax for TurboFTP SCP server vs Linux/BSD:

  • If the destination is a remote directory (e.g. 'newdir' in the following examples), it should have an ending slash to eliminate ambiguity.
    # not recommended
    scp -P 7222 *.jpg joe@remotehost.com:/newdir
    # correct
    scp -P 7222 *.jpg joe@remotehost.com:/newdir/
    # wrong, will return "illegal D msg 'D0755 0 testdir'" if 'newupdir' doesn't exist
    $ scp -P 7222 -r testdir/ joe@remotehost.com:/newupdir
    # The following works, with local directory 'testdir' having an ending slash or not. # 'testdir' will be created at remote under 'newupdir'. However, 'newupdir' won't be created if it doesn't exist. # correct
    $ scp -P 7222 -r testdir/ joe@remotehost.com:/newupdir/
    $ scp -P 7222 -r testdir joe@remotehost.com:/newupdir/
  • TurboFTP Server doesn't yet support regular expression wildcard.