Difference between revisions of "Install SSH"

From AwkwardTV
Jump to: navigation, search
(New page: =Step 1= create the directory "fw" in /Volumes/OSBoot/System/Library/StartupItems/ =Step 2= Create the file "StartupParameters.plist" in /System/Library/StartupItems/fw/ code: { Descr...)
 
m (formatting)
Line 1: Line 1:
 +
__NOTOC__
 
=Step 1=
 
=Step 1=
 
create the directory "fw" in /Volumes/OSBoot/System/Library/StartupItems/
 
create the directory "fw" in /Volumes/OSBoot/System/Library/StartupItems/
Line 7: Line 8:
 
code:
 
code:
  
{
+
{
  Description = "Firewall";
+
  Description = "Firewall";
  Provides = ("Firewall");
+
  Provides = ("Firewall");
  Requires = ("Network");
+
  Requires = ("Network");
  OrderPreference = "None";
+
  OrderPreference = "None";
}
+
}
  
 
=Step 3=
 
=Step 3=
Line 19: Line 20:
 
code:
 
code:
  
<nowiki>#!/bin/sh</nowiki>
+
#!/bin/sh
 
+
<nowiki>/sbin/ipfw -f flush</nowiki>
+
/sbin/ipfw -f flush
<nowiki>/sbin/ipfw add 65535 allow ip from any to any</nowiki>
+
/sbin/ipfw add 65535 allow ip from any to any
  
 
=Step 4=
 
=Step 4=
Line 32: Line 33:
 
code:
 
code:
  
<?xml version="1.0" encoding="UTF-8"?>
+
<?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">
+
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
+
<plist version="1.0">
<dict>
+
<dict>
        <key>Label</key>
+
        <key>Label</key>
        <string>com.openssh.sshd</string>
+
        <string>com.openssh.sshd</string>
        <key>Program</key>
+
        <key>Program</key>
        <string>/usr/libexec/sshd-keygen-wrapper</string>
+
        <string>/usr/libexec/sshd-keygen-wrapper</string>
        <key>ProgramArguments</key>
+
        <key>ProgramArguments</key>
        <array>
+
        <array>
                <string>/usr/sbin/sshd</string>
+
                <string>/usr/sbin/sshd</string>
                <string>-i</string>
+
                <string>-i</string>
        </array>
+
        </array>
        <key>SessionCreate</key>
+
        <key>SessionCreate</key>
        <true/>
+
        <true/>
        <key>Sockets</key>
+
        <key>Sockets</key>
        <dict>
+
        <dict>
              <key>Listeners</key>
+
              <key>Listeners</key>
                <dict>
+
                <dict>
                        <key>Bonjour</key>
+
                        <key>Bonjour</key>
                        <array>
+
                        <array>
                                <string>ssh</string>
+
                                <string>ssh</string>
                                <string>sftp-ssh</string>
+
                                <string>sftp-ssh</string>
                        </array>
+
                        </array>
                        <key>SockServiceName</key>
+
                        <key>SockServiceName</key>
                        <string>ssh</string>
+
                        <string>ssh</string>
                </dict>
+
                </dict>
        </dict>
+
        </dict>
        <key>StandardErrorPath</key>
+
        <key>StandardErrorPath</key>
        <string>/dev/null</string>
+
        <string>/dev/null</string>
        <key>inetdCompatibility</key>
+
        <key>inetdCompatibility</key>
        <dict>
+
        <dict>
                <key>Wait</key>
+
                <key>Wait</key>
                <false/>
+
                <false/>
        </dict>
+
        </dict>
</dict>
+
</dict>
</plist>
+
</plist>  
  
 
=Step 4=
 
=Step 4=
Log in like this: ssh -1 frontrow@your.appletv.ip
+
Log in like this:  
 +
 
 +
ssh -1 frontrow@your.appletv.ip
  
 
Password "frontrow"
 
Password "frontrow"
 
 
This page needs to be formatted properly. I'm off to lunch, will work on it later -mrfett
 

Revision as of 11:42, 24 March 2007

Step 1

create the directory "fw" in /Volumes/OSBoot/System/Library/StartupItems/

Step 2

Create the file "StartupParameters.plist" in /System/Library/StartupItems/fw/

code:

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

Step 3

Create the shell script "fw" in /System/Library/StartupItems/fw/

code:

#!/bin/sh

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

Step 4

copy sshd from /usr/sbin to /Volumes/OSBoot/usr/sbin/ (use an Intel-compiled version)

Step 5

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

code:

<?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 4

Log in like this:

ssh -1 frontrow@your.appletv.ip

Password "frontrow"