Installing a newer SSH2

May 27, '01 10:06:33PM

Contributed by: outofcontrol

[Editor's note: Although Mac OS X includes SSH2, there is a newer version with some improvements - the most notable of which is the removal of the connection delay that you get with the current version. Here's a how-to from a macosxhints reader for the newest version. I have not tested this myself as of yet, but I'd expect it to work as described]

Installing SSH2 on OSX is relatively simple. The step-by-step I got partly from the 2.4.0 version of SSH README and in great part from http://osx.u.nu. If you'd like the full step-by-step instructions, read the rest of this article...

First download the latest version from ssh.org.

You will then need to launch the terminal and change directory to where you downloaded the tarball. From within the terminal do the following simple steps (lines with "#" at the front are comments; do not type them):

tar -zxf
ssh-2.4.0.tar.gz
cd ssh-2.4.0
./configure --without-x
make
# You need to be root to do the final step
su
# I am running bash on my OS X, I have heard you might need
# to export $PATH=$PATH:/usr/sbin to work in other shells.
make install
Then you will need to setup the autostartup files (this is what i got from osx.u.nu)

Made a copy of the Apache startup entry:
cd /System/Library/StartupItems
cp -R Apache SSH
cd SSH
mv Apache SSH
Next, change the files inside the SSH directory to work with SSH rather than Apache (this has no effect on Apache, since we're working with a fresh copy of the directory). Here's what my files look like:

SSH:
#!/bin/sh
##
# Start Secure Shell daemon
##
. /etc/rc.common
if [ "${SSHD:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Starting secure shell daemon"
/usr/local/sbin/sshd2
fi
StartupParameters.plist:
{
Description = "SSH secure shell daemon";
Provides = ("Secure shell service");
Requires = ("Disks", "Resolver");
OrderPreference = "None";
Messages =
{
start = "Starting secure shell daemon";
stop = "Stopping secure shell daemon";
};
}
Resources/English.lproj/Localizable.strings:
Be sure to change the text strings to something like this
Starting secure shell daemon
Starting secure shell
If you are using a different language you will need to edit the file in the appropriate directory (where I used English.lproj). The 'key' should match the 'start' line in StartupParameters.plist, and the 'string' should be that string translated into your language.

Next, add the line:
SSHD=-YES-
to the end of /etc/hostconfig. You'll notice there's an option in there for SSHSERVER, but it doesn't seem to do anything. It doesn't look like SSH server binaries come with the install anymore.

Please note that SSH2 server is not yet running. You can either restart your machine or invoke the daemon from the terminal with
/usr/local/sbin/sshd2
Restarting your machine will ensure that your settings work properly however.

I discovered that since I already had SSH1 installed, and it had binded itself to port 22, I needed to kill it first in order to get SSH2 working. I did this by finding the pid of the process with either top or with ps ax and then killed the process with kill -HUP {pid#}.

This is by no means definitive guide to installing SSH2, but it did work well for me.

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20010527220633471