1) Download the openssh from http://www.openssh.org/portable.html
2) Configure and make the sources:
# ./configure --with-kerberos5 --with-tcp-wrappers --with-pam
# ./make
2.1) Common errors:
"configure: error: PAM headers not found"3) You can do a "make install" but i wouldn't do that if you have already an ssh daemon installed, from sources or any package manager like rpm or apt.
Solution: yum install pam-devel
4) Copy the ssh daemon directory or link to it from /usr/local/sbin/
# ln -s ./openssh-new /usr/local/sbin/sshd-new/
5) Supposing that you already have a /etc/ssh/sshd_config file, then you have to create
another configuration file for the new ssh server, lets put it in another directory:
/usr/local/etc/ssh/sshd_config
And edit this sshd_config file and put there this line, or edit it if it already exists:
# This line specifies which port you want to use:
Port 2253
6) Create the ssh key files:
# ssh-keygen -t rsa -f /usr/local/etc/ssh/ssh_host_rsa_key
# ssh-keygen -t dsa -f /usr/local/etc/ssh/ssh_host_dsa_key
7) Make sure that in the startup script /etc/init.d/sshd2 you instruct the daemon where to find its key files, something like this:
# Some functions to make the below more readable
KEYGEN=/usr/local/sbin/openssh-5.2p1/ssh-keygen
SSHD=/usr/local/sbin/openssh-5.2p1/sshd
RSA1_KEY=/usr/local/etc/ssh/ssh_host_key
RSA_KEY=/usr/local/etc/ssh/ssh_host_rsa_key
DSA_KEY=/usr/local/etc/ssh/ssh_host_dsa_key
PID_FILE=/var/run/sshd2.pid
OPTIONS="-f /usr/local/etc/ssh/sshd_config"
8) Finally, start the new ssh server.
/etc/init.d/sshd2 start






