Skip to content

Instantly share code, notes, and snippets.

@mkll
Created September 10, 2018 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkll/6e86d27f4b256c3720eb7b73793779d4 to your computer and use it in GitHub Desktop.
Save mkll/6e86d27f4b256c3720eb7b73793779d4 to your computer and use it in GitHub Desktop.
Install HPN-SSH

Install HPN-SSH

via:

The point of this guide is to allow a user to install HPN-patched version of SSH without overriding the system-installed OpenSSH.

I use the following pattern for lo-fi, manual package management

/usr/local/versions/${PACKAGE_NAME}/${VERSION}

For this package, I will be using the following prefix:

/usr/local/versions/openssh/6.1p1-hpn13v14

download source

cd ~/src
curl -O http://openbsd.org.ar/pub/OpenBSD/OpenSSH/portable/openssh-6.1p1.tar.gz
curl -OLJ http://www.psc.edu/index.php/component/remository/func-download/861/chk,f3db9830e15be5125dfb0404f535bf2d/no_html,1/

extract source

tar -xzf openssh-6.1p1.tar.gz
gunzip openssh-6.1p1-hpn13v14.diff.gz

patch openssh with hpn kitchen sink

cd openssh-6.1p1
patch -p1 < ../openssh-6.1p1-hpn13v14.diff

configure, make, install

I have my own version of OpenSSL installed (via homebrew), so I have to use the --with-ssl-dir parameter. For those that just have system-installed OpenSSL, you can ignore this

./configure --prefix=/usr/local/versions/openssh/6.1p1-hpn13v14 \
            --with-ssl-dir=/usr/local/Cellar/openssl/1.0.1e
make
make install

symlink binaries

cd /usr/local/bin
ln -s ../versions/openssh/6.1p1-hpn13v14/bin/scp scp
ln -s ../versions/openssh/6.1p1-hpn13v14/bin/sftp sftp
ln -s ../versions/openssh/6.1p1-hpn13v14/bin/slogin slogin
ln -s ../versions/openssh/6.1p1-hpn13v14/bin/ssh ssh
ln -s ../versions/openssh/6.1p1-hpn13v14/bin/ssh-add ssh-add
ln -s ../versions/openssh/6.1p1-hpn13v14/bin/ssh-agent ssh-agent
ln -s ../versions/openssh/6.1p1-hpn13v14/bin/ssh-keygen ssh-keygen
ln -s ../versions/openssh/6.1p1-hpn13v14/bin/ssh-keyscan ssh-keyscan

check the install

which ssh

You should see /usr/local/bin/ssh

cleanup

rm -rf ~/src/openssh-6.1p1*

uninstall

remove symlinks

rm -f /usr/local/bin/{scp,sftp,slogin,ssh,ssh-add,ssh-agent,ssh-keygen,ssh-keyscan}

remove installed files

rm -rf /usr/local/versions/openssh/6.1p1-hpn13v14

remove openssh directory if no other versions are present

rm 2&>1 -d /usr/local/versions/openssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment