[Editor's note: The following applies to the Public Beta only. The current release version of OS X does not contain SSH; search the site for articles on installing SSH if you'd like to use it. Rumor has it that the first OS X update will again include SSH]
If you access your OS X box remotely, you can do so through an incredibly simple-to-use Telnet server (simply click "Turn on remote Telnet access" on the Sharing System Preference panel). However, this is not the best way to connect to your OS X box - your passwords are transmitted in cleartext (non encrypted), meaning that they could be intercepted by those with malicious intents.
OS X includes a built-in secure remote access package known as SSH (Secure SHell). However, there is no GUI for enabling SSH, which is unfortunate (hopefully this will be changed prior to final release). It is not, however, overly difficult to enable SSH using a terminal session, if you're reasonably comfortable with editing files in the shell.
If you access your machine remotely, and you would like to do so more securely, read the rest of this article for information on how to enable and use SSH.
The process required to get SSH running is as follows:
suand then enter your root password.
cd /etc
cp hostconfig hostconfig.bak
vi hostconfig
SSHSERVER=-NO-to this
SSHSERVER=-YES-
cd /System/Library/StartupItems/SSHExecute the SSH command:
./SSHYou should see the following text appear on screen
Starting Secure Login ServerThis is where it gets a bit confusing, as there are two SSH protocols - SSH1 and SSH2. You can connect fine with SSH1, but the next steps will enable SSH2, so that both SSH1 and SSH2 clients can connect to your machine.
error: Could not load DSA host key: /etc/ssh_host_dsa_key
Disabling protocol version 2
vi SSH
if [ ! -f /etc/ssh_host_key ]; thenYou are going to insert a new IF statement after the current one, and before the SSHD command. The new if statement is:
echo "Generating ssh host key..."
ssh-keygen -f /etc/ssh_host_key -N "" -C "$(hostname)"
fi
sshd
if [ ! -f /etc/ssh_host_dsa_key ]; thenWhen you are done, there should be two separate IF statements, and then the SSHD command as before. Do not change any other portion of this file.
echo "Generating ssh host key..."
ssh-keygen -d -b 1024 -f /etc/ssh_host_dsa_key -N "" -C "$(hostname)"
fi
ssh username@hostnameAlternatively, you can separate the user and host by typing
ssh -l username hostnameusername is obviously your user name, and hostname is either the domain name or IP address of your OS X box. If you don't have a domain name or static IP address, you'll need to use one of the dynamic naming services (see this link on Versiontracker) or have some other method of determining your IP number. Either version of the command should come back with a password prompt, at which you would enter your normal user's password, and you will then be connected securely to your OS X box.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20010105010922535