Skip to content

Instantly share code, notes, and snippets.

@rikka0w0
Last active April 14, 2023 06:20
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 rikka0w0/2314802674ab4cf13924025d7202f001 to your computer and use it in GitHub Desktop.
Save rikka0w0/2314802674ab4cf13924025d7202f001 to your computer and use it in GitHub Desktop.
Compile OpenSSH on Linux
#!/bin/bash
mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
apt install build-essential zlib1g-dev libssl-dev libpam0g-dev libselinux1-dev
wget -c http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.0p1.tar.gz
tar -xzf openssh-8.0p1.tar.gz
rm openssh-8.0p1.tar.gz
cd openssh-8.0p1
./configure --with-md5-passwords --with-pam --with-selinux --with-privsep-path=/var/run/sshd/ --sysconfdir=/etc/ssh
make -j2
make install
#/usr/local/sbin/sshd -p 25565
#edit /lib/systemd/system/ssh.service
#/usr/sbin -> /usr/local/sbin
systemctl daemon-reload
systemctl restart ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment