[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 -zxfThen you will need to setup the autostartup files (this is what i got from osx.u.nu)
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
cd /System/Library/StartupItemsNext, 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:
cp -R Apache SSH
cd SSH
mv Apache SSH
#!/bin/shStartupParameters.plist:
##
# Start Secure Shell daemon
##
. /etc/rc.common
if [ "${SSHD:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Starting secure shell daemon"
/usr/local/sbin/sshd2
fi
{
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:
Starting secure shell daemonIf 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.
Starting secure shell
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.
/usr/local/sbin/sshd2Restarting your machine will ensure that your settings work properly however.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20010527220633471