Difference between revisions of "Install SSH"

From AwkwardTV
Jump to: navigation, search
Line 64: Line 64:
 
  </plist>
 
  </plist>
  
=Step 4=
+
=Step 6=
Log in like this:  
+
Log in like this:
 
+
<pre>
ssh -1 frontrow@your.appletv.ip
+
ssh -1 frontrow@AppleTV.local
 
+
</pre>
 
Password "frontrow"
 
Password "frontrow"

Revision as of 22:01, 24 March 2007

These instructions are for installing ssh on the Apple TV from an Intel Mac (if you don't have an Intel Mac, you need to find another source for sshd). You need to remove the Apple TV's hard drive and mount it using some sort of firewire or usb enclosure, perform the below steps, and then reinstall the drive.

Step 1

Create the directory fw in /Volumes/OSBoot/System/Library/StartupItems/.

Step 2

Create the file StartupParameters.plist in /System/Library/StartupItems/fw/ with the following text:

{
  Description = "Firewall";
  Provides = ("Firewall");
  Requires = ("Network");
  OrderPreference = "None";
}

Step 3

Create the shell script fw in /System/Library/StartupItems/fw/ with the following text:

#!/bin/sh

/sbin/ipfw -f flush
/sbin/ipfw add 65535 allow ip from any to any

Step 4

Copy sshd from /usr/sbin/ on your local Intel Mac, to /Volumes/OSBoot/usr/sbin/ on the Apple TV HD. (You have to use an Intel-compiled version)

Step 5

Rewrite /System/Library/LaunchDaemons/ssh.plist on your Apple TV with this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>com.openssh.sshd</string>
        <key>Program</key>
        <string>/usr/libexec/sshd-keygen-wrapper</string>
        <key>ProgramArguments</key>
        <array>
                <string>/usr/sbin/sshd</string>
                <string>-i</string>
        </array>
        <key>SessionCreate</key>
        <true/>
        <key>Sockets</key>
        <dict>
              <key>Listeners</key>
                <dict>
                        <key>Bonjour</key>
                        <array>
                                <string>ssh</string>
                                <string>sftp-ssh</string>
                        </array>
                        <key>SockServiceName</key>
                        <string>ssh</string>
                </dict>
        </dict>
        <key>StandardErrorPath</key>
        <string>/dev/null</string>
        <key>inetdCompatibility</key>
        <dict>
                <key>Wait</key>
                <false/>
        </dict>
</dict>
</plist>

Step 6

Log in like this:

ssh -1 frontrow@AppleTV.local

Password "frontrow"