[xaine@www ~]$ uname -mnrs
  FreeBSD www.xaine.org 4.x-RELEASE i386
About Xaine
 History
 Biography

 
My Tutorials
 Upgrade SSH
 Postfix with SASL
 Postfix SASL + TLS

 
My Experiments
 Linux Router on CD
 Dissecting Nokia IP130

 
Cool Links
 Slashdot
 Sun BigAdmin
 DistroWatch
 Protocols

 
Tools
 Binary Packages
 Source Code


Last Update : Jan 2005
# Written by Daniel Lee [email protected]
#


Howto upgrade SSHD without rebooting.

Where to download OpenSSH - www.openssh.org

Download a new version of OpenSSH from www.openssh.org.

We first need to understand the existing OpenSSH directories.
bindir		= /usr/bin
sbindir		= /usr/sbin
datadir		= /usr/share
sysconfdir	= /etc/ssh
mandir		= /usr/share/man

Extract the package openssh-x.x.x.tgz with 'tar zxvf openssh-x.x.x.tgz'

In order for the newly built binary to be 
cd openssh-x.x.x
./configure --prefix=/usr --sysconfdir=/etc/ssh --mandir=/usr/share
make

Now run the newly built SSHD on a secondary port say 8022 by typing 'sshd -p 8022'
'netstat -an' will show both listening ports
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:8022            0.0.0.0:*               LISTEN

Logout of the existing session and connect a SSH session on port 8022.
Upon entry, SU to root and kill the SSHD listening on port 22.

Replace the newly built ssh to /usr/bin and sshd to /usr/sbin.
Run the replaced SSHD /usr/sbin/sshd

Do a telnet 'telnet host.foobar.com 22' 
you should see the new version banner

Verify you can login on the default port before you kill the SSHD on 8022.


ps : of course mine will not show the version, it just shows
SSH-2.0-xaine-labs

It's in place to deter wardriving scripts from attacking SSH