-
-
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 |
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.
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
For some reason the "sed" command doesn't seem to do anything? Any help? I'm not familiar with sed.
Thanks in advance :)