Enable SSH & AFP on your Apple TV

by editor @ AppleTVHacks.net on March 24, 2007

Credit for the original information used in making this how-to goes to TylerL82 over at the SomethingAwful.com forums. Written up here by Jonathan Bare.

So while you have your Apple TV open and you’re installing a new hard drive or just following along with the people over at SomethingAwful.com forums to get Xvid working, you might as well un-break SSH so you can access the Apple TV remotely.

Opening the Apple TV and connecting the hard drive to your Intel Mac are covered in the hard drive upgrade and elsewhere, so we’ll skip those steps and jump right to the point where you have the OSBoot and Media volumes mounted on your Mac.

This process assumes using an Intel Mac because the sshd binary may or may not be the same in the PowerPC version of Mac OS X; we haven’t checked. If someone would like to try using the PowerPC binary and let us know if it works, that would be great!

There are 2 ways to go about this; using the finder, or via the terminal. The finder method is probably best if you aren’t sure what is going on, whereas the Terminal method is quicker if you are confident.

Step 1 – Using the Finder

Once you have OSBoot mounted in the Finder, double click on its icon. You’ll see something like this:

ssh howto 1 Enable SSH & AFP on your Apple TV

From the Finder’s Go menu, select Go To Folder, or press Command-Shift-G. Type in and click Go.

ssh howto 2 Enable SSH & AFP on your Apple TV

Open a new Finder window and do the same thing to go to a folder, this time, however, select /usr/sbin/. This is the same folder located on your Mac’s hard drive.

ssh howto 3 Enable SSH & AFP on your Apple TV

From the Mac’s sbin folder, drag the file “sshd” to the Apple TV’s sbin folder. Your cursor will change in to the green plus sign to indicate that you are making a copy of the file.

Note: If you have accidentally ended up in /usr/bin instead of /usr/sbin and you accidentally copy the “ssh” file instead of “sshd”, you’ve made a big mistake and ssh will not work on your Apple TV. Be sure you are working to and from the respective /usr/sbin directories.

ssh howto 4 Enable SSH & AFP on your Apple TV

You now have sshd installed on your OSBoot volume. Now we need sshd to start when the Apple TV boots up.

In the OSBoot window, choose Go To Folder again and this time, enter .

ssh howto 5 Enable SSH & AFP on your Apple TV

If you open the Apple TV’s ssh.plist file from the LaunchDaemons directory, you’ll see why we need to replace it. Apple left a dummy plist file to throw us off the trail.

ssh howto 6 Enable SSH & AFP on your Apple TV

You could copy the ssh.plist file from the same location in your Mac’s /System/Library/LaunchDaemons/, but for simplicity, we’ve included the contents of the plist here (if you do copy from your Mac, ensure SSH is enabled in System Preferences -> Sharing, or it won’t work – thanks to Adam Gill). Using TextEdit, BBEdit, or your favorite text editor, copy and paste this text, replacing the original ssh.plist contents:

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

Close the file and save it. In a nut shell, the ssh daemon is activated by launchd whenever an incoming connection on port 22 is detected.

Step 1 – Using the Terminal

Firstly, copy the sshd binary from your Mac to the AppleTV drive:


cp /usr/sbin/sshd /Volumes/OSBoot/usr/sbin/.

Next, copy the ssh.plist file over, so launchd knows to start sshd on boot:

Alternatively, you could use the contents of the file from above to create an ssh.plist file.

Step 2

Unmount the OSBoot and Media volumes, reassemble your Apple TV, and power it on. You need to get the IP address of the Apple TV from the Settings menu, once you know that, open a Terminal window from your Mac (or any OS that has ssh installed) and type:

ssh frontrow@your.apple.tv.ip.address

Press return. Type “yes” when it asks if you want to permanently store the key. Then enter “frontrow” as the password.

You’re in.

Now what?

SSH opens up a lot of doors to accessing the Apple TV. For example, you can now type sudo /usr/sbin/AppleFileServer and cause the built-in Apple File Protocol (AFP) server to start. Then you can connect to the Apple TV from your Mac by using the Connect to Server command in the Finder. AFP, SCP or SFTP can now be used to copy files to the Apple TV!!

You can type ps auxww to see a list of running processes on your Apple TV. (Hey, what is /usr/bin/ripstop and why is it running under the frontrow user?)

One thing we’ve already learned from SSH is that the root filesystem on the Apple TV (aka OSBoot) is apparently mounted as a read-only filesystem. That means it’s not initially possible to copy any files to the root mount point (/etc, /usr, /var, for example) while it is running. TylerL82 has commented to point out you can remedy this with the sudo mount -uw / command.

It’s also important to note that any changes you make to the OSBoot volume will be wiped out by a Factory Restore of the Apple TV. It appears that a disk image of the stock Apple TV operating system exists on the unlabeled partition on the drive and is used to restore the OSBoot volume when Factory Restore is selected.

Share and Enjoy:
  • Digg
  • del.icio.us
  • StumbleUpon
  • Facebook
  • MySpace
  • Technorati
  • Google Bookmarks
  • Fark
  • Furl
  • LinkedIn
  • Live
  • Meneame
  • NewsVine
  • Ping.fm
  • Propeller
  • Reddit
  • Slashdot
  • Tumblr
  • TwitThis
  • Wikio
  • Yahoo! Buzz
  • J
    I wonder how long it's going to be before the hackers have something resembling full-fledged OSX running on this thing :)
  • dice
    I'd love to know how to do this with a windows XP pc/laptop... As I don't have access to a mac powerbook (I do intend on buying one some day, now probably sooner than later), is this at all possible to do with a windows PC?
  • Tom @ AppleTVHacks.net
    dice-

    There is a program, Macdrive, which will allow you to mount the Apple TV harddrive.

    You would then need to obtain a copy of sshd from an Intel Mac owning friend; and create the plist file from the details given. Copy them to the correct locations and you should be all done!

    You could then use Putty for SSH access, and WinSCP for SFTP/SCP file transfers.
  • TylerL82
    sudo mount -uw /

    ...will mount the AppleTV's OSBoot partition read/write when run via ssh.
  • if you touch an empty file in the root directory (/Volumes/OSBoot when connected to your laptop, or / from ssh after a mount -uw /) call .readwrite then whenever your AppleTV boots it will be mounted rw.

    You can also copy over su to get to a real 'root' userid, or just cp /bin/sh /bin/shroot and chmod 4755 it.

    you can also enable root by moving over the passwd command and setting the password. Of course beware of all the security implications.
  • Jonathan
    Well duh. Thanks Tyler. :)

    From there, you can scp the directory /usr/libexec/httpd/ from your Mac to the Apple TV. Then run:

    sudo /usr/sbin/apachectl start

    http://your.apple.tv.ip
    or
    http://yourappletvname.local

    Pow. Apache is running. The default httpd.conf file uses the /Library/WebServer/Documents/ directory for its DocumentRoot and also enables the user-level Sites folder, so this also works:

    http://your.apple.tv.ip/~frontrow
    or
    http://yourappletvname.local/~frontrow
  • Scott
    Thanks for this. I had done this previously without success and then tried again with your instructions. I'm always getting

    ssh frontrow@10.0.1.200
    Connection closed by 10.0.1.200

    Not sure what to do next.
  • Oh, and I'm sure others have tried it, but plugging in a USB keyboard and then holding down Apple-V shows you the normal verbose boot, and Apple-S does boot to a single-user root prompt (or it did for me on my already modified atv), but then there's no HID driver loaded so you can't type anything....
  • Jonathan
    Scott:

    Try ssh with the -v switch to get the verbose connection. That could tell you what's going wrong.

    ssh -v frontrow@10.0.1.200
  • I'm interested in what a port scan of an Apple TV results in. Although I hear the firewall is enabled by default on them.

    I've heard they ship with Apple Remote Desktop client installed. I hate to state the obvious, but has anyone tried copying over their Mac's ARD client preferences over/manually starting the client?
  • Scott
    Thanks,

    It seems that kerberos is active and the realm can't be found. Trying to figure this out.

    DSBuch: [whsbti] scott $ ssh -v frontrow@10.0.1.200
    OpenSSH_4.5p1, OpenSSL 0.9.7l 28 Sep 2006
    debug1: Reading configuration data /Users/scott/.ssh/config
    debug1: Reading configuration data /etc/ssh_config
    debug1: Connecting to 10.0.1.200 [10.0.1.200] port 22.
    debug1: Connection established.
    debug1: identity file /Users/scott/.ssh/identity type 1
    debug1: identity file /Users/scott/.ssh/id_rsa type 1
    debug1: identity file /Users/scott/.ssh/id_dsa type -1
    debug1: Remote protocol version 1.99, remote software version OpenSSH_4.5
    debug1: match: OpenSSH_4.5 pat OpenSSH*
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_4.5
    debug1: An invalid name was supplied
    Cannot determine realm for numeric host address

    debug1: An invalid name was supplied
    Cannot determine realm for numeric host address

    debug1: SSH2_MSG_KEXINIT sent
    Connection closed by 10.0.1.200
  • Peter da Silva
    Why on earth would you even imagine the Power PC binary would work?

    # file /usr/sbin/sshd
    /usr/sbin/sshd: Mach-O executable ppc
  • Scott
    Not sure what you're referring to?? I copied over Universal version from my Macbook Pro.

    DSBuch: [whsbti] scott $ file /usr/sbin/sshd
    /usr/sbin/sshd: Mach-O universal binary with 2 architectures
    /usr/sbin/sshd (for architecture i386): Mach-O executable i386
    /usr/sbin/sshd (for architecture ppc): Mach-O executable ppc
  • Scott
    Just to complete my story. I randomly tried ssh switches (last resort you know) and found I can get is with the ssh 1 protocol ??????? so

    ssh -1 frontrow@appletv works

    Anyone who can think what it would be appreciated
  • I get:

    [Spike:~] mrfett% ssh -1v frontrow@appletv.local
    OpenSSH_4.5p1, OpenSSL 0.9.7l 28 Sep 2006
    debug1: Reading configuration data /etc/ssh_config
    debug1: Connecting to appletv.local [192.168.1.159] port 22.
    debug1: Connection established.
    debug1: identity file /Users/mrfett/.ssh/identity type -1
    ssh_exchange_identification: Connection closed by remote host

    if anyone could help me, it'd be appreciated.
  • same thing with the ip address put in explicitly, btw.
  • here are the results of a portscan using nmap after installing ssh as outlined above:

    PORT STATE SERVICE
    22/tcp open ssh
    3689/tcp open rendezvous


    Nmap finished: 1 IP address (1 host up) scanned in 577.723 seconds
  • for those of you getting the "Connection closed by remote host" error after installing ssh as outlined above, all you need to do is specify ssh version 1.
    like this:
    ssh -1 frontrow@192.168.1.152

    and BAM! you're in :)
  • Dak
    Can someone please upload the Universal Binary version of sshd? I am a PowerPC user myself, so I havent got anywhere to get it from.
  • you can get root access by simply using su after logging in via ssh:

    -bash-2.05b$ sudo su root
    su-2.05b#
  • After three days I figured out my problem. Kudos to this post for helping me, as I only thought of the solution after using the Finder to look at the files (I had been using the terminal previous to that). I noticed that my sshd file wasn't being classified as a UNIX shell script, but was being called a "Document". On a whim, I used "chmod +x sshd" to strip the owner, and voila! it worked. I'm extremely happy. I don't know why I seem to be the only person who experienced this problem, but whatever. Hope this helps someone.
  • Jonathan
    I've seen the -1 switch used to degrade the SSH protocol to SSHv1, but standard ssh username@ip and ssh -2 username@ip has worked fine for me. I'm clueless as to why you'd have a problem with SSHv2.

    On a local network, you're probably fine with just v1.
  • Jonathan
    I'd like to play around more with the /etc/rc script and the toss in the /etc/hostconfig file. Oh, where to find the time?

    I briefly had ARD/VNC working, but it seems to crash after a few seconds each time I activate it with kickstart and connect.
  • I managed to get ARD working by using the usual command-line enable sequence:

    ./kickstart -activate -configure -access -on -restart -agent -privs -all

    (from /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/Resources )

    you may need to enable apple remote events using systemsetup as well.

    it's a ARD 2.2.1 client, so it may not work with ARD 3. Also some functions don't work because the sysinfocachegen command gets a bus error.

    however it doesn't seem to useful, as it doesn't respond to any keyboard/mouse input -- probably because there's no input drivers...
  • someone on the awkward irc channel helped me get it working. we put the info on the wiki.

    http://wiki.awkwardtv.org/wiki/index.php?title=...
  • iw
    I followed the following instructions for xvid support:
    1. Open it up (4 screws on the bottom, small Torx bit)
    2. Put the 2.5" drive into a USB enclosure or whatever you want
    3. Mount the HFS filesystem
    4. Install Perian in /Library/Quicktime (as you normally would)
    5. Install Dropbear (or enable SSH if you know how... we gave up and used Dropbear)
    6. Add a startup script to disable the firewall or open up the ports you need for SSH
    7. Put the drive back in and boot it, ssh login as frontrow, password frontrow (or add an ssh key for yourself)
    8. Use a reference movie (use QT Pro to save a reference movie) to bootstrap your xvid file


    Thanks to this page i got up to step 4. So from here does anyone know how to do step "Add a startup script to disable the firewall or open up the ports you need for SSH."

    Oh and has anyone actually got this xvid thing working?
  • Below is a link to the Intel compiled sshd binary, suitible for use on the AppleTV.

    http://www.rghosting.com/AppleTV/

    If anyone wants any other files hosting on our mirror, please use the contact us link on that page.
  • Roger
    I'm interested in finding out whether someone with a PPC Mac has attempted this (using the Intel binary of ssh, of course). Is there a risk of the PPC Mac damaging the GUID partition?
  • Jonathan
    I've been looking at the configuration and preference files that make up the Internet Sharing abilities of a standard Mac OS X system.

    It appears that...

    /etc/com.apple.named.conf.proxy
    /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist
    /Library/Preferences/SystemConfiguration/com.apple.nat.plist
    /Library/Preferences/SystemConfiguration/preferences.plist

    /usr/libexec/InternetSharing
    /usr/sbin/named
    /usr/sbin/natd

    ...are at least required and some modification of the conf and plist files will be necessary. The binaries in /usr already appear to be included in the Apple TV, but no way yet of knowing if they actually work.

    Enabling this would allow the Apple TV to be used as a very simple software base station (access point) or a bridge from Airport to Ethernet.

    More to come...
  • Lewiss
    Can someone please tell me how to get read and write privileges? I see you saying mount -uw but I have no idea what that means... The more simple, the better. Thanks
  • cklapka
    I get connection refused when I set this up, thoughts?

    cklapkas-MBP:~ cklapka$ ssh -v frontrow@10.0.1.xxx
    OpenSSH_4.5p1, OpenSSL 0.9.7l 28 Sep 2006
    debug1: Reading configuration data /etc/ssh_config
    debug1: Connecting to 10.0.1.xxx [10.0.1.xxx] port 22.
    debug1: connect to address 10.0.1.xxx port 22: Connection refused


    I followed all the instructions while replacing/upgrading my harddrive, I assume I would get another error in the was not service was not running, correct?

    Any help would be great.

    Thanks in advance
    cklapka
  • Adam
    Just wondering, has anyone done a uname -a on one of these things? I'd just be interested in which rev. of darwin they're running
  • Adam
    nevermind, it's part way down this page, 8.8.2

    http://www.appletvhacks.net/2007/03/23/apple-tv...
  • If you use the Terminal commands to copy your current ssh plist file form /System/Library/LaunchDaemons/ssh.plist, you have to have your current ssh settings in your sharing preferrences turned on. Otherwise the first line in the plist file is:



    Disabled

    Label
    com.openssh.sshd
    Program

    this will Keep ssh disabled.

    if it is on, you'll get:



    Label
    com.openssh.sshd
    Program
    Which turns on ssh.

    Or you could edit the plist file to remove the Disabled True key.
  • k
    after I typed ssh -1 frontrow@10.0.1.xxx , Ican see

    Password:
    Response:


    and then I can't type anything at all.. what shold I need to do?
  • k
    if I just press return key... I can see this below

    Connection closed by 10.0.1.xxx
  • k
    nevermind... everything is working fine now
  • Here is a great page for AFP:
    http://docs.info.apple.com/article.html?artnum=...

    Apple Remote Desktop 2 or later include the "kickstart" command line utility. It allows you to install, uninstall, activate, configure, and restart components of Apple Remote Desktop without restarting the computer. You can configure all the features found in Apple Remote Desktop preferences.

    The kickstart utility is located here:

    /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart

    You need an administrator account to use the kickstart utility. To begin using the kickstart utility, use the sudo command, such as:

    $ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent

    Note: All commands presented in this document should be typed as one line of text. It's OK if the text wraps as you enter it, just be sure not to enter hard carriage returns.

    Following are some examples of other things you could do.

    1. Activate Remote Desktop Sharing, enable access privileges for all users, restart ARD Agent:

    $ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -restart -agent -privs -all

    2. Activate Remote Desktop Sharing, enable access privileges for the users "admin", grant full privileges for the users "admin", restart ARD Agent and Menu extra:

    $ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users admin -privs -all -restart -agent -menu

    Note: The -users flag should refererence the shortname of a user of the system.

    3. Activate Remote Desktop Sharing, disable access privileges for all users:

    $ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -off

    4. If you just want to stop the ARD Agent process:

    # sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -agent -stop

    5. If you want to deactivate it:

    # sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off

    Tip: For more information about using the kickstart command, add the -help flag. For example:

    # sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -help
  • Patchsmyle
    An addendum to make connecting to the SSH connection one step easier. AppleTVs automatically name themselves "AppleTV.local" for bonjour. Thus rather then ssh -1 frontrow@ip.address.here you can use ssh -1 frontrow@AppleTV.local (Capitalization is important here)

    Something else to help coders on looking for binary dependancies. There is a CLI tool called "otool". It is part of the Apple Developer package XCode. If you run: otool -L you can see the dependancies that binary needs to function.


    Hope my 2 cents helps some one!

    Enjoy
    PatchSmyle
  • Tolga
    How can i get AFP enabled on bootup?
    i dont´t want to do it everytime manually with ssh, is there a way i can change a setting which forces ATV to start AppleFileServer by itself on every bootup???
  • Like cklapka, I cannot connect after doing this. Everything worked ok opening the appletv and setting up SSH, but I always get 'Connection Refused' when I try to ssh.

    my-computer-2:/dev me$ ssh -v frontrow@192.168.1.14
    OpenSSH_4.2p1, OpenSSL 0.9.7l 28 Sep 2006
    debug1: Reading configuration data /etc/ssh_config
    debug1: Connecting to 192.168.1.14 [192.168.1.14] port 22.
    debug1: connect to address 192.168.1.14 port 22: Connection refused
    ssh: connect to host 192.168.1.14 port 22: Connection refused

    Does anyone know why this is? I did the terminal copies of sshd and ssh.plist.
  • pete
    Hi,

    Like a few people above I cannot connect. However my ssh stops at ssh_exchange_identifaction. I copied sshd and ssh.plist via terminal to the OSBoot volume. Does anyone know how to fix this?

    $ ssh -vv -l frontrow 192.168.x.x
    OpenSSH_4.2p1, OpenSSL 0.9.7i 14 Oct 2005
    debug1: Reading configuration data /Users/me/.ssh/config
    debug1: Reading configuration data /etc/ssh_config
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to 192.168.x.x
    [192.168.x.x] port 22.
    debug1: Connection established.
    debug1: identity file /Users/me/.ssh/identity type -1
    debug1: identity file /Users/me/.ssh/id_rsa type -1
    debug1: identity file /Users/me/.ssh/id_dsa type -1
    ssh_exchange_identification: Connection closed by remote host

    -pete
  • Mizzo
    Like monkeyroy and cklapka, I also can't connect. The connection is refused. Any help?
  • ppcuser
    Is there any possibility to enable ssh using a Powerbook?

    Greets ppcuser
  • I got it working. I had copied my ssh.plist from my macbook but I did not have ssh enabled on my macbook. So I recreated the ssh.plist on the appletv drive and copied the contents into it from the tutorial and now it works.

    BTW I personally did not need to use the -1 ssh switch to connect. Just doing ssh frontrow@myappletvip worked.
  • Pete
    Hi,

    I have copied the sshd binary to the appletv hard disk, copied ssh.plist from my
    mac (with ssh enabled). However connections are close by the server when I try to
    login.

    $ ssh -vvv frontrow@appletv
    OpenSSH_4.2p1, OpenSSL 0.9.7i 14 Oct 2005
    debug1: Reading configuration data /Users/me/.ssh/config
    debug1: Reading configuration data /etc/ssh_config
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to appletv [192.168.2.100] port 22.
    debug1: Connection established.
    debug1: identity file /Users/me/.ssh/identity type -1
    debug1: identity file /Users/me/.ssh/id_rsa type -1
    debug1: identity file /Users/me/.ssh/id_dsa type -1
    ssh_exchange_identification: Connection closed by remote host


    Any ideas what's wrong with it?
  • Pete
    Solved this:

    ssh_exchange_identification: Connection closed by remote host

    Found a tip here: http://www.engadget.com/2007/04/10/how-to-play-...

    chmod +x /Volumes/OSBoot/usr/sbin/sshd

    However it won't still let me in:

    $ ssh -vvv frontrow@appletv
    OpenSSH_4.2p1, OpenSSL 0.9.7i 14 Oct 2005
    debug1: Reading configuration data /Users/me/.ssh/config
    debug1: Reading configuration data /etc/ssh_config
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to appletv [192.168.2.100] port 22.
    debug1: Connection established.
    debug1: identity file /Users/me/.ssh/identity type -1
    debug1: identity file /Users/me/.ssh/id_rsa type -1
    debug1: identity file /Users/me/.ssh/id_dsa type -1
    debug1: Remote protocol version 1.99, remote software version OpenSSH_4.5
    debug1: match: OpenSSH_4.5 pat OpenSSH*
    debug1: Enabling compatibility mode for protocol 2.0
    debug1: Local version string SSH-2.0-OpenSSH_4.2
    debug2: fd 3 setting O_NONBLOCK
    debug1: Miscellaneous failure
    No credentials cache found

    debug1: Miscellaneous failure
    No credentials cache found

    debug1: SSH2_MSG_KEXINIT sent
    Connection closed by 192.168.2.100

    Any ideas what's missing?
  • Adam
    Pete --

    See #19 above.
  • rolf
    New harddrive installed and works. I used the disk utility in order the get all the files moved. Once I got an error I use toast to mount the image and copied the files.

    I followed instructions. I do have a powermac G5 and installed the intel based sshd file from a web site for people how do not have an InterMac . The entire folder is called OpenSSH-56.root and I used the mod command chmod +x /Volumes/OSBoot/usr/sbin/sshd

    I am still getting connection refused. (see below)

    ssh -vvv frontrow@192.168.0.xx
    OpenSSH_4.5p1, OpenSSL 0.9.7l 28 Sep 2006
    debug1: Reading configuration data /etc/ssh_config
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to 192.168.0.xx [192.168.0.xx] port 22.
    debug1: connect to address 192.168.0.xx port 22: Connection refused
    ssh: connect to host 192.168.0.xx port 22: Connection refused

    Does anyone has an idea what I am doing wrong.
  • Pete
    Thanks Adam I missed that. Just typed

    ssh -1 frontrow@appletv

    and I'm in :)
  • Martin
    Any help would be awesome.....I'll stuck at this "line 63".
    What am i doing wrong.


    Thanks in advanced.
    Martin


    mach_kernel.prelink 100% 6159KB 1.5MB/s 00:04
    Uncompressing the original './mach_kernel.prelink'...
    /private/var/root/Desktop/AppleTVHacks_USB_patch/install-atvrhd.sh: line 63: ./prelink_tool/prelink_tool: No such file or directory
    Patching the original './mach_kernel.prelink'...
    bspatch: kernel/kernel.uncompressed.patch: No such file or directory
    Harrys-Macbook-Pro:~ root#
  • Vaughn
    Is there a way to disable the AppleTV firewall? I cannot seem to write anything to the AppleTV drive
  • guy
    way i have
    connect to host 192.168.0.3 port 22: Connection refused
    maybe you can help me with this?
  • MR B
    I have the same problem, i have the 160gb version, and software 1.1
  • Roman
    Can I do that without opening the Apple TV by booting it from a USB drive?
    Is there a Linux distribution, which one could boot off and then mount the internal drive files systems to make the necessary changes?
  • Peter Bangkok
    Hi you nice guys.
    I have finally my NitoTV working.
    What I'm missing is a hint how I can access my files stored on my MAC. using ATV.
    I really have problems how to set up AFPoverTCP. Could somebody give me a hint how to do our where I could find a link how to do.
    Thanks
  • chinlumg
    I have the same problem
    i have connect to host show

    macs-computer-2:/ MAC$ ssh -1 -v frontrow@192.168.0.46
    OpenSSH_4.2p1, OpenSSL 0.9.7l 28 Sep 2006
    debug1: Reading configuration data /etc/ssh_config
    debug1: Connecting to 192.168.0.46 [192.168.0.46] port 22.
    debug1: Connection established.
    debug1: identity file /Users/MAC/.ssh/identity type -1
    debug1: Remote protocol version 1.99, remote software version OpenSSH_4.5
    debug1: match: OpenSSH_4.5 pat OpenSSH*
    debug1: Local version string SSH-1.5-OpenSSH_4.2
    debug1: Waiting for server public key.
    debug1: Received server public key (768 bits) and host key (2048 bits).
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that the RSA1 host key has just been changed.
    The fingerprint for the RSA1 key sent by the remote host is
    c5:53:76:88:3c:fd:98:8c:e0:0d:aa:40:20:dd:67:f1.
    Please contact your system administrator.
    Add correct host key in /Users/MAC/.ssh/known_hosts to get rid of this message.
    Offending key in /Users/MAC/.ssh/known_hosts:1
    RSA1 host key for 192.168.0.46 has changed and you have requested strict checking.
    Host key verification failed.

    please help me~~
  • Viny
    Same problem here:

    ssh: connect to host 10.0.1.200 port 22: Connection refused

    Any solution?
  • mr_matalino
    The key is in the following line:

    Offending key in /Users/MAC/.ssh/known_hosts:1

    Navigate to that folder and delete the file (usually hidden)
  • miguel
    It doesn't work for me.
    I copy the sshd file with the comand
    cp /usr/sbin/sshd /Volumes/OSBoot/usr/sbin/.
    and I get a read-only file system alert

    I try
    sudo mount -uw /Volumes/OSBoot/
    in order to forcet it as readwrite and I get
    "mount: unknown special file or file system /Volumes/OSBoot/."

    Is there a way I can mount OS.dmg with read write permitions?
    I have also run
    mount -o rw OS.dmg /Volumes/OSBoot/
    and I got the error: "OS.dmg on /Volumes/OSBoot: Block device requeired"

    Does any one have a clue of what else could I do?
  • eric
    Help!
    i keep getting Connection closed by remote host.
    I have tried different way this is what i get

    Last login: Sat Nov 3 19:34:39 on ttys000
    Macintosh:~ mac$ ssh frontrow@10.0.1.200
    ssh_exchange_identification: Connection closed by remote host
    Macintosh:~ mac$ ssh -1 frontrow@10.0.1.200
    ssh_exchange_identification: Connection closed by remote host
    Macintosh:~ mac$ ssh -2 frontrow@10.0.1.200
    ssh_exchange_identification: Connection closed by remote host
    Macintosh:~ mac$ ssh -v frontrow@10.0.1.200
    OpenSSH_4.5p1, OpenSSL 0.9.7l 28 Sep 2006
    debug1: Reading configuration data /etc/ssh_config
    debug1: Connecting to 10.0.1.200 [10.0.1.200] port 22.
    debug1: Connection established.
    debug1: identity file /Users/mac/.ssh/identity type -1
    debug1: identity file /Users/mac/.ssh/id_rsa type -1
    debug1: identity file /Users/mac/.ssh/id_dsa type -1
    ssh_exchange_identification: Connection closed by remote host
    Macintosh:~ mac$


    I am on a 24in Imac running 10.5 I do not know what i am doing wrong. any ideas. Thanks
  • fortnighttv
    I'm getting the same thing:

    Macmini$ ssh -1v frontrow@appletv.local
    OpenSSH_4.5p1, OpenSSL 0.9.7l 28 Sep 2006
    debug1: Reading configuration data /etc/ssh_config
    debug1: Connecting to appletv.local [192.168.15.100] port 22.
    debug1: Connection established.
    debug1: identity file /Users/Macmini/.ssh/identity type -1
    ssh_exchange_identification: Connection closed by remote host

    I'm using OSX 10.5. Can that be a problem?
  • eric
    I got it working, i used the sshd file from patchstick download .dmg . this worked. the 10.5 must be different
  • eric
    Now i can not get the apple file server to run. I tried sudo /usr/sbin/AppleFileServer
    then entered the password frontrow. then i get ( sudo: /usr/sbin/AppleFileServer: command not found ) any ideas. thank you
  • fortnighttv
    Yeah. Confirmed here. I had to use the sshd from the patchstick.dmg also. Now I'm in but can''t activate the Apple File server either. Someone help us!!! Please!
  • fortnighttv
    I keep getting this:
    -bash-2.05b$ sudo /usr/sbin/AppleFileServer
    sudo: /usr/sbin/AppleFileServer: command not found
  • eric
    I used Fugu to transfer filed to the apple tv. i was able to move atv loader to the home folder. Download FUGU and connect to AppleTV.local,user name frontrow and password frontrow, check force ssh1. That allowed me to move files to the apple tv. But i still can not figure out how to run the atv loader installme.
    When i try sudo ./installme it returns with command not found.
    Any ideas would help. Thank you
  • fortnighttv
    Got it! In v.1.1 the AppleFileServer app is missing. To restore the app, use these commands and voila!, you can then activate using the sudo /usr/sbin/AppleFileServer command and afp into the apple tv. Copy one line at a time.

    sudo mount -o remount,rw /dev/disk0s3 /
    cd ~
    mkdir mnt
    sudo mount -t hfs /dev/disk0s2 mnt
    hdiutil attach mnt/OS.dmg
    sudo cp -R /Volumes/OSBoot\ 1/System/Library/CoreServices/AppleFileServer.app /System/Library/CoreServices
    hdiutil detach /Volumes/OSBoot\ 1/
    sudo umount mnt
    rmdir mnt
    sudo mount -o remount,ro /dev/disk0s3 /

    I'm now able to Connect.
  • eric
    Any one know how to install ATVLoader. I have the AtvLoader folder on my apple tv in the home folder with ssh on, but i do not know how to run the install commands via ssh. Please help. Thank you.
  • Rick Abrams
    I have a great home theater system. It is based on hardware/software from a company called Control4. www.control4.com

    One of the best parts of the system is that I have video switching so I can watch any video signal (DVD players, cabel boxes, etc., etc.) on any tv in the house.

    I can also choose to watch apple tv and an iMac on any tv since they are also video sources on the system. After installing Leopard, the iMac video signal doesn't work on the tv's. We've been playing with displayconfigx and Switchresx but haven't yet been able to get the iMac to send the proper resolution, etc. to the TVs.

    I very much miss watching video (from any web site) on my Tv's. With Apple TV, I can only watch videos from iTunes which I also do but it is pretty limited.

    Since the apple tv takes care of resolutions so well, I am wondering if anyone knows how I could watch video from any website throught the Apple TV on my TV's? If I could do this I wouldn't need to have direct access to my iMac.

    Or if anyone can help me figure out how to get my system working again so that the iMac can work with various TV's, I'd appreciate that too.

    Thanks in advance.
    Rick
  • Tick
    Just a heads up to those attempting to use a PPC based mac... I've got 10.5 running, but the sshd from that doesn't work either.

    For whatever reason when I attach the drive with no apps open (except Finder and Dock of course) I see the two volumes mount on the desktop, and then I get a spinning pinwheel until I force poweroff the machine.

    When I boot to the install CD and open terminal from there (single user mode doesn't autoboot the USB drive) I can access the drive no problem at all.
  • Tick
    Scrap that last post, when you run: file shhd for the sshd binary that comes on 10.5, it is compiled both for PPC and i386. The reason it wasn't working, is I was trying to use Putty from a Windows machine using SSH2, and I guess it needed to be set to SSH1.

    So for all you PPC based users, you can use your Leopard binary :)
  • Raffi Parikian
    I followed the instructions to the T and am getting "Server Unexpectedly Closed Network Connection" Can anyone help with this?
  • gt
    is there a way to recover from the boot disk in terminal?
    My atv gets stuck at the apple logo and wont boot or allow me to ssh.
  • Guido79
    Getting the following output error:

    Macintosh-115:~ me$ ssh -vvv frontrow@10.0.1.230
    OpenSSH_4.5p1, OpenSSL 0.9.7l 28 Sep 2006
    debug1: Reading configuration data /etc/ssh_config
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to 10.0.1.230 [10.0.1.230] port 22.
    debug1: Connection established.
    debug1: identity file /Users/me/.ssh/identity type -1
    debug1: identity file /Users/me/.ssh/id_rsa type -1
    debug1: identity file /Users/me/.ssh/id_dsa type -1
    ssh_exchange_identification: Connection closed by remote host

    Copied sshd from Mac OS X 10.5.2 and used plist from my Mac mini. Do I need to use a different sshd or do I need to just modify access privileges.
  • Pete
    I've just been trying to get this working, and had the same problems. I had no success with the 10.5.1 binary from my MacBookPro, so you may be suffering the same problems I did. I grabbed an older version from 'Mac OS X 10.4.9 Update (Intel)' for my Mac and grabbed the sshd from the Archive.pax.gz. (You can just download that from the apple website and extract using the 'pax' tool)

    I've also been trying to get this working on the 2.0 release, which is a great improvement with the Apple TV functionality. I'm not sure whether there's major differences between v1.0 and v2.0, the kernel looks the similar, whether the libraries are compiled differently I don't know at this point, i've not attempted to add any other software to it.

    It seems in v1.0 there were some parts of ssh still available on the ATV, namely /usr/libexec/ssh-keygen-wrapper and /usr/bin/ssh-keygen being the important files in addition to /usr/sbin/sshd. Installing /usr/sbin/sshd is covered above. Modifying ssh.plist is also covered above, though ssh.plist refers to ssh-keygen-wrapper which no longer exists in v2.0, so grab a copy from another Mac and install it into /usr/libexec. The only other binary you'll need is /usr/bin/ssh-keygen. I just grabbed the same version as the one which was on my ATV (v1.0) previously, but if you've already upgraded, the quick tests I did on the version in the 10.4.9 update mentioned above seems to work fine.

    Kerberos framework is useful to allow sshv2, but again I found 10.5.1 wasn't any good. I grabbed from 10.4.9 Update or from Security Update 2007-09, sorry, can't remember exactly which one now. And you'll probably want /usr/bin/scp too if you plan on copying files over ssh, that's missing from ATV v2 too. But once you've got everything on there, it just works as expected.

    It's certainly caused me to get more under the skin with Mac OSX, and I have to say it's been a pleasant experience. launchd looks like much of an improvement over the traditional unix tools.

    Now to see if I can get MythTV frontend on this, then I can remove my linux machine, and with the features in ATV v2 i'm keen to make the switch.

    Oh, and if it's helpful to anyone having issues here, you can always enable telnet (Copy in /usr/libexec/telnetd and modify /System/Library/LaunchDaemons/telnetd.plist and remove the 2 lines which disable it) As telnet is more simply than ssh (no encryption, and only relys on telnetd binary and no other files) its useful in allowing you to get access and find out what the issues are. Take note, did I mentioned there's no encryption?! Fine if you're accessing this only over your own internal LAN.
  • stever
    I recently updated my Apple TV to V2 via the normal (Apple) update, and then decided to upgrade to a Seagate 160GB drive from the original stock 40GB. I used diskutil and dd to generate the image and copy to the new drive. Everything worked great except for the last step:

    diskutil eraseVolume "Journaled HFS+" Media /dev/disk3s4
    DiskManagement setuid-tool failure
    diskutil eject disk3
    Disk disk3 ejected
    gpt show disk3
    gpt show: error: bogus map
    diskutil eject disk3
    Disk disk3 ejected
    gpt recover disk3
    gpt recover: error: bogus map

    At this point, I wimped out and bought the iPartition utility for $50. That allowed me to keep the media dir contents intact.

    Following very carefully Pete's detailed post about the missing elements for ssh and scp in the V2 OSBoot volume, I used the public Darwin 8.0.1 iso for /usr/libexec/sshd-keygen-wrapper, /usr/bin/ssh-keygen, /usr/sbin/sshd and /usr/bin/scp. My ssh.plist was exactly as documented by Bare, and I used chown to return owner of my inserted files back to root. Finally, I removed the .Spotlight-V100 files from both volumes.

    The new drive with V2 + (hopefully ssh) booted normally and showed 144.63GB as the new media partition. But this made my evening:

    ssh -1 frontrow@appletv.local
    The authenticity of host 'appletv.local (10.0.0.4)' can't be established.
    RSA1 key fingerprint is 6c:e5:4b:19:ba:a4:2c:5c:1e:0f:2d:95:29:ac:00:76.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'appletv.local,10.0.0.4' (RSA1) to the list of known hosts.
    Password:
    Response:
    Last login: Sun Feb 17 21:05:29 2008
    -bash-2.05b$ top
    -bash: top: command not found
    -bash-2.05b$ pwd
    /Users/frontrow
    -bash-2.05b$ ls -la
    total 8
    drwxr-xr-x 12 frontrow frontrow 408 Feb 17 21:05 .
    drwxrwxr-t 5 root admin 170 Feb 12 22:31 ..
    -rw-r--r-- 1 frontrow frontrow 3 May 31 2001 .CFUserTextEncoding
    drwx------ 2 frontrow frontrow 68 Feb 17 21:05 .Trash
    drwx------ 3 frontrow frontrow 102 Aug 1 2006 Desktop
    drwx------ 3 frontrow frontrow 102 Aug 1 2006 Documents
    drwx------ 19 frontrow frontrow 646 Feb 12 22:33 Library
    drwx------ 3 frontrow frontrow 102 Aug 1 2006 Movies
    drwx------ 3 frontrow frontrow 102 Aug 1 2006 Music
    drwx------ 3 frontrow frontrow 102 Aug 1 2006 Pictures
    drwxr-xr-x 4 frontrow frontrow 136 Aug 1 2006 Public
    drwxr-xr-x 5 frontrow frontrow 170 Mar 14 2007 Sites
    -bash-2.05b$

    Summarizing - this is a V2 Apple TV via the official update, running ssh.
  • DavidS
    If you see this:

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

    The solution is simple. In a Terminal:

    rm ~/.ssh/known_hosts


    You could also go in and remove the individual host entries if you know how to do so. Removing the file will cause no harm however.
  • Phil
    For those getting the "ssh_exchange_identification: Connection closed by remote host" and "Server Unexpectedly Closed Network Connection" type of errors when attempting to enable ssh on a Take 2-upgraded unit, some information in this post on AwkwardTV finally got it working for me. Specifically, copying ALL of the ssh/scp/sftp files listed there (not just the subset I'd previously seen mentioned in other ssh-enabling tutorials), and duplicating the exact file permissions from a live OSX system (including setuid bits and whatnot) finally got things working.
  • Secure1
    The steps above do not appear to work on the new Macs. I was unable to find the OSboot or Volumes with the find. However, I am a bit of a newb. Is there updated instructions? I have a new intel Mac Pro Book with Applve TV ver 2
blog comments powered by Disqus