Install SSH with Leopard

From AwkwardTV

Jump to: navigation, search

These instructions are for installing ssh on a "Take 2" Apple TV from a Mac with Leopard.

I put them together from other pages in this wiki. The point with Mac OS X Leopard is that the binaries are not compatible with the AppleTV, at least not the one I have on my MacPro. These instructions should also work on a PPC Mac (G3, G4, or G5). Or even (sigh!) on a PC with another terminal client such as PuTTY

A "Take 2" Apple TV is an AppleTV with the 2.x upgrade.

I took the option of opening the box and taking out the harddisk. People wanting to keep the AppleTV sealed can refer to the method with an external USB drive.

Contents

Preparations

You will need the AppleTV harddisk and a Darwin x86 iso both mounted on your machine.

AppleTV harddisk

  • Set the network settings on the Apple TV.
  • Optional: update it to the latest version.
  • Power off the Apple TV and remove the harddisk.
  • Connect it to your Mac, e.g. with an USB to IDE adapter.
  • Optional: backup the Apple TV harddisk to a file on your computer.

Darwin x86 iso

Installation

At this point, you should see the following drives on your desktop:

  • the AppleTV OSBoot boot drive,
  • the AppleTV Media drive, which we are not interested in,
  • the Darwin Darwin8_i386 drive.

If the Darwin drive has a different name, you will have to modify the SOURCE='/Volumes/Darwin8_i386' code accordingly in the following instructions.

SSH

We now just have to copy files from the Darwin iso to AppleTV boot drive.

Start Terminal. You may want to su just to make sure you have all privileges. Copy the following commands and paste them in the terminal.

export SOURCE='/Volumes/Darwin8_i386'
export DEST='/Volumes/OSBoot'
cp -p $SOURCE/usr/sbin/sshd $DEST/usr/sbin/
cp -p $SOURCE/usr/bin/ssh $DEST/usr/bin/
cp -p $SOURCE/usr/bin/ssh-add $DEST/usr/bin/
cp -p $SOURCE/usr/bin/ssh-agent $DEST/usr/bin/
cp -p $SOURCE/usr/bin/ssh-keygen $DEST/usr/bin/
cp -p $SOURCE/usr/bin/ssh-keyscan $DEST/usr/bin/
cp -p $SOURCE/usr/bin/scp $DEST/usr/bin/
cp -p $SOURCE/usr/libexec/sftp-server $DEST/usr/libexec/
cp -p $SOURCE/usr/libexec/ssh-keysign $DEST/usr/libexec/
cp -p $SOURCE/usr/libexec/sshd-keygen-wrapper $DEST/usr/libexec/

If you have a Mac with ssh enabled, copy the following file:

cp -p /System/Library/LaunchDaemons/ssh.plist $DEST/System/Library/LaunchDaemons/

Otherwise, create a text file /Volumes/OSBoot/System/Library/LaunchDaemons/ssh.plist containing the text found in the base SSH install page.

Kerberos framework

The base SSH install page suggests also installing the Kerberos framework.

However I could ssh to the AppleTV with the above Kerberos install (without ssh -1).

Other commands

As you later want to log to your AppleTV and play around, you might as well copy the following binaries:

cp -p $SOURCE/usr/bin/at $DEST/usr/bin/
cp -p $SOURCE/usr/bin/bunzip2 $DEST/usr/bin/
cp -p $SOURCE/usr/bin/bzip2 $DEST/usr/bin/
cp -p $SOURCE/usr/bin/clear $DEST/usr/bin/
cp -p $SOURCE/usr/bin/cmp $DEST/usr/bin/
cp -p $SOURCE/usr/bin/diff $DEST/usr/bin/
cp -p $SOURCE/usr/bin/du $DEST/usr/bin/
cp -p $SOURCE/usr/bin/env $DEST/usr/bin/
cp -p $SOURCE/usr/bin/getopt $DEST/usr/bin/
cp -p $SOURCE/usr/bin/getopts $DEST/usr/bin/
cp -p $SOURCE/usr/bin/gunzip $DEST/usr/bin/
cp -p $SOURCE/usr/bin/gzip $DEST/usr/bin/
cp -p $SOURCE/usr/bin/killall $DEST/usr/bin/
cp -p $SOURCE/usr/bin/nano $DEST/usr/bin/
cp -p $SOURCE/usr/bin/nc $DEST/usr/bin/
cp -p $SOURCE/usr/bin/passwd $DEST/usr/bin/
cp -p $SOURCE/usr/bin/printenv $DEST/usr/bin/
cp -p $SOURCE/usr/bin/printf $DEST/usr/bin/
cp -p $SOURCE/usr/bin/screen $DEST/usr/bin/
cp -p $SOURCE/usr/bin/sftp $DEST/usr/bin/
cp -p $SOURCE/usr/bin/sort $DEST/usr/bin/
cp -p $SOURCE/usr/bin/stat $DEST/usr/bin/
cp -p $SOURCE/usr/bin/strings $DEST/usr/bin/
cp -p $SOURCE/usr/bin/su $DEST/usr/bin/
cp -p $SOURCE/usr/bin/tee $DEST/usr/bin/
cp -p $SOURCE/usr/bin/telnet $DEST/usr/bin/
cp -p $SOURCE/usr/bin/time $DEST/usr/bin/
cp -p $SOURCE/usr/bin/top $DEST/usr/bin/
cp -p $SOURCE/usr/bin/unzip $DEST/usr/bin/
cp -p $SOURCE/usr/bin/uptime $DEST/usr/bin/
cp -p $SOURCE/usr/bin/users $DEST/usr/bin/
cp -p $SOURCE/usr/bin/uudecode $DEST/usr/bin/
cp -p $SOURCE/usr/bin/uuencode $DEST/usr/bin/
cp -p $SOURCE/usr/bin/which $DEST/usr/bin/
cp -p $SOURCE/usr/bin/zip $DEST/usr/bin/

AppleTV reboot

  • Eject the Darwin x86 iso and the AppleTV partitions.
  • Transfer the harddisk back to the Apple TV.
  • Power it on.

Login

Find your AppleTV by pinging it:

ping appletv.local

If nobody answers to appletv.local, you'll have to connect to it by its IP address which you can find in the AppleTV's setup menu.

Login to your AppleTV with:

ssh frontrow@appletv.local

The password, as shipped from Apple, is frontrow.

At this point, you might want to modify your login options.

The user "frontrow" has sudo privileges. Change to root user with:

sudo -s

From AppleTV 2.1, the command su works. Change to root user with:

su

Shutdown the AppleTV with:

sudo halt

Note that version 2.3 has a Settings/Standby command.

As a next step, you might want to configure bash.

Personal tools