Jul 27, 2024
HPN-SSH is a fork of SSH that’s tuned for performance. One thing it let’s you do is to send files over without any encryption, which speeds things up a lot! It’s not secure though so you should only do it over a local connection I believe. But if you want to transfer files over your local connection it makes stuff like rsync way more usable.
In order to get it working you need to have it running both on your local and remote machine. The remote machine needs to be running the hpn-ssh server and you use the hpn-ssh client to connect to it. There’s currently no homebrew formula for it working, but I was able to build it for macOS pretty easily.
These commands from the hpn-ssh github worked fine on macOS. Just included the number of cores I wanted to use for make (-j4
) and used sudo make install
git clone https://github.com/rapier1/hpn-ssh
cd openssh-portable
autoreconf
./configure
make -j4
sudo make install
Now you’ll have the hpn-ssh client installed on your local machine. To get it installed on Debian Linux, I used:
sudo add-apt-repository ppa:rapier1/hpnssh
sudo apt update
sudo apt install -y hpnssh
Then you have to edit /etc/hpnssh/sshd_config
:
sudo vim /etc/hpnssh/sshd_config
And uncomment or enter:
NoneEnabled yes
The NoneEnabled means that it supports connecting over ssh with no encryption, which is what we want for our speed increase.
Finally in order to send stuff over rsync using hpn-ssh with no encryption, we use the following command:
rsync -e 'hpnssh -oNoneSwitch=yes -oNoneEnabled=yes' -WvaPh ~/myLocalDir remote:remoteDir/
The keypart is the -e 'hpnssh -oNoneSwitch=yes -oNoneEnabled=yes'
which is what makes it use hpn-ssh with no encryption. vaPh
is just standard rsync stuff and -W
disables rsync’s delta transfer mode and just transfers whole files which we want for performance anyways.
Getting all this running was a little convoluted because there really aren’t any instructions of what to do from beginning to end, and there have been some changes to the process. Like I think previously in older versions, hpn-ssh just used to patch the ssh daemon, but now there’s a separate server program called hpnssn with its own config. You’ll see online some people telling you to edit the standard sshd_config and add NoneEnabled yes
but that won’t work for the latest version. Also it wasn’t clear how to get rsync to actually use hpnssh with no encryption and so on. Anyways this setup seems to be good and there’s definitely a speed increase. Hope this helps, God bless!