Skip to content

Instantly share code, notes, and snippets.

@dasgoll
Forked from imagescape/Install Openssh from Source
Last active November 24, 2018 00:12
Show Gist options
  • Select an option

  • Save dasgoll/7d7a38a903650a330bd99fdb004cccaf to your computer and use it in GitHub Desktop.

Select an option

Save dasgoll/7d7a38a903650a330bd99fdb004cccaf to your computer and use it in GitHub Desktop.
Install openssh in an alternate location from source
sudo yum -y groupinstall 'Development Tools'
git clone https://github.com/Linuxbrew/brew.git ~/.linuxbrew
#echo 'export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"' >>~/.profile
echo 'export MANPATH="/home/linuxbrew/.linuxbrew/share/man:$MANPATH"' >>~/.profile
echo 'export INFOPATH="/home/linuxbrew/.linuxbrew/share/info:$INFOPATH"' >>~/.profile
sudo yum groupinstall 'Development Tools'
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
#echo 'export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"' >>~/.profile
echo 'export MANPATH="/home/linuxbrew/.linuxbrew/share/man:$MANPATH"' >>~/.profile
echo 'export INFOPATH="/home/linuxbrew/.linuxbrew/share/info:$INFOPATH"' >>~/.profile
-----
# 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