Skip to content

Instantly share code, notes, and snippets.

@bechampion
Created December 2, 2017 17:30
Show Gist options
  • Save bechampion/7acbfa231c28dd72b673440a52b419b2 to your computer and use it in GitHub Desktop.
Save bechampion/7acbfa231c28dd72b673440a52b419b2 to your computer and use it in GitHub Desktop.
OPENSSH=/opt/openssh2
mkdir -p /opt/openssh2/dist/
cd ${OPENSSH}
wget http://zlib.net/zlib-1.2.11.tar.gz
tar xvfz zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=${OPENSSH}/dist/ && make && make install
cd ${OPENSSH}
wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz
tar xvfz openssl-1.0.1e.tar.gz
cd openssl-1.0.1e
./config --prefix=${OPENSSH}/dist/ && make && make install
cd ${OPENSSH}
wget https://ftp.eu.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-6.2p1.tar.gz
tar xvfz openssh-6.2p1.tar.gz
cd openssh-6.2p1
sed -e 's/struct passwd \* pw = authctxt->pw;/logit("Honey: Username: %s Password: %s", authctxt->user, password);\nstruct passwd \* pw = authctxt->pw;/' -i auth-passwd.c
./configure --prefix=${OPENSSH}/dist/ --with-zlib=${OPENSSH}/dist --with-ssl-dir=${OPENSSH}/dist/ && make && make install
@borosilicate
Copy link

Same problem as above!

@m4gg1
Copy link

m4gg1 commented Jan 10, 2021

For some reason the "sed" command doesn't seem to do anything? Any help? I'm not familiar with sed.
Thanks in advance :)

@snehasurna1875
Copy link

Can you please let me know on which system do you installed it. As I was trying to installed it into Ubuntu system. As ubuntu come with pre installed Openssh , so I removed it and install again from portable file followed the same procedure mentioned above but it didn't work. In auth.log file it was not creating log of passwords.

@snehasurna1875
Copy link

On ubuntu system I removed the pre existing openssh-client and openssh-server and followed the installation procedure mentioned in (https://www.linuxfromscratch.org/blfs/view/svn/postlfs/openssh.html) and modified auth-passwd.c as mentioned in (https://www.programmersought.com/article/15074277797/) and before installing openssh from scratch install dependencies by command -apt install build-essential zlib1g-dev libssl-dev. It worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment