How to Use HPN SSH with SFTP Command – Terminal Guide

command linefile-transfersftpsshterminal

I've installed hpn ssh using this command:

sudo port install openssh +hpn

I want to transfer lost data (100GB at least) using sftp command terminal command.

I am wondering, is installing hpn ssh all I need to do to gain speed advantage with sftp command? After installing hpn ssh, my current upload speed is around 1.8MB (i have a line of 2.5 MB, so that is pretty close). Sadly, I didn't do a test before installing it. stupid me

Also, I noticed that transferring lots of individual files takes a lot more time than transferring 1 big file. Is zipping all the files and than sending that 1 zip the recommended way of transfering to remote host? I would prefer the option to not zip the files first, since zipping 100GB takes some time.

If you know a better solution to transfer large amount of data to remote host, I am open to it:)

Best Answer

MacPorts would install sftp in /opt/local/bin/. You can test against the OS installed /usr/bin/sftp.

The OS installed zip uses gzip compression by default but can be configured to use bzip2 (with the -Z option) which should give you better compression. I would split the 100GB of files into smaller archives.

Next, consider using tar or xar to create your archives. tar with xz should give you the best compression,xz should already be installed by MacPorts. Of course these suggestions depend upon the tools available on the remote host.

Related Question