Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jcPOLO/824f946e3caf31aebf70431d3cc1f46d to your computer and use it in GitHub Desktop.
Save jcPOLO/824f946e3caf31aebf70431d3cc1f46d to your computer and use it in GitHub Desktop.
Install openssh in an alternate location from source
# We will assume installation in the /opt/ directory
mkdir /opt/openssh/
cd /opt/openssh/
# gather and install the dependencies
wget http://zlib.net/zlib-1.2.7.tar.bz2
tar jxvf zlib-1.2.7.tar.bz2
cd zlib-1.2.7
./configure --prefix=/opt/openssh/dist/
make
make install
cd ../
wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz
tar zxvf openssl-1.0.1e.tar.gz
cd openssl-1.0.1e
./config --prefix=/opt/openssh/dist/
make
make install
# install the openssh source code (pick a mirror on http://www.openssh.org/portable.html)
wget http://mirror.team-cymru.org/pub/OpenBSD/OpenSSH/portable/openssh-6.2p1.tar.gz
tar zxvf openssh-6.2p1.tar.gz
cd openssh-6.2p1
./configure --prefix=/opt/openssh/dist/ --with-zlib=/opt/openssh/dist --with-ssl-dir=/opt/openssh/dist/
make
make install
# to run the ssh daemon:
sudo /opt/openssh/dist/sbin/sshd -f /opt/openssh/dist/etc/sshd_config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment