If you’ve been tinkering around with your Apple TV 4jailbroken on tvOS 10 with liberTV, you may have noticed that its built-in SSH client, Dropbear, has a tendency to be purged every so often, requiring it be re-spawned and set up again. This is due to the developer’s (admirable) desire to retain all jailbreak-related files in temporary folders on the filesystem, reducing the risk of bricking your device while fiddling with it to near-zero. If you are confident enough to move a few files out of their temporary folder however, you can easily get your SSH client up and running persistently, avoiding those tedious reconfigurations which otherwise occur.

Before beginning, read through the guide so you understand what we’re doing, including my concluding remarks beneath Step 17. Whilst this process should be very safe, exercise caution and common sense, and do not overwrite any pre-existing files which you obviously did not put there yourself.

Article image

How to make Dropbear persistent

1)Ensure that your Apple TV 4 is in a jailbroken state via liberTV.My guide will show you how to do this.

2)Connect to your Apple TV via SSH, and make sure you have changed your default passwords.My guide will show you how to do this.

3)Open up an SSH session to your Apple TV as detailed in the guide linked in Step 2, and issue the following command:

export PATH=/tmp/bin:/tmp/usr/bin:/tmp/usr/local/bin:/tmp/sbin

4)Now type the following commands one at a time (each line is a command to be entered separately):

5)We have moved to the root of the file system and listed the folders there. Check that you have a folder calledtmp; this is where our Dropbear files are. Now enter the following:

6)Look for a folder entitledetc, and if present,cdinto it:

7)Now look for a folder inetcentitleddropbear. If present,cdinto it:

cd dropbearls

We should see the Dropbear files we are interested in listed here. In my case there was only one,dropbear_ecdsa_host_key, though you may have others. Verify that you can see them in this folder, which is/tmp/etc/dropbear/. If you can’t, make sure you are in the correct folder. You can return to the root at any time and start again withcd /, followed byls, if necessary. If you can’t find them or are in the wrong directory the process won’t work, which is why we need to visually verify them before we continue.

If they’re there, we can now proceed to make a new home for them on the permanent filesystem, and copy them out of the precarious temporary folder they began in.

Do this at your own risk! Whilst this should be perfectly safe, I will not be held responsible for human error. If you overwrite any existing system binaries, you will be forced to restore your Apple TV, so copy only the items listed here, and ensure they do not already exist at their destination first.

8)Type the following to move away from our verified Dropbear files intmp, and move to the location we want to copy them to:

You should now see the contents of the system’setcfolder.

9)We want to make a folder here inetccalleddropbear, which we do with the following command:

mkdir ./dropbear

Typelsagain afterwards, and verify that the contents ofetcare as before, except for the addition of the newdropbearfolder we just created.

10)If all the contents are still there, plus our newdropbearfolder, issue the following command to copy our Dropbear files from/tmp/etc/dropbearto their new location at/etc/dropbear:

mv /tmp/etc/dropbear/* … /etc/dropbear/

My system reported a “No such file or directory” error here, but worked regardless.

11)Check the copy has been successful by typingcd dropbear, followed byls, and making sure our file(s) (dropbear_ecdsa_host_keyand any others you saw in Step 7), are present.

We have now successfully moved the contents of/tmp/etc/dropbearto/etc/dropbear, where they will not be removed by the system.

We must now move a second group of files in the same way, from/tmp/usr/local/binto/usr/local/bin.

12)Type the following to move to/tmp/usr/local/bin, and check its contents are there, ready for copying:

cd /tmp/usr/local/binls

You should see a collection of Dropbear-related files, I had eight in total. If they’re not there, ensure you are in the right directory. If you cannot find them in the correct directory then the process will not work.

13)Once you’ve verified the files we want are there, let’s move to where we want to move them to, by typing:

Check the list of contents and ensure that there isn’t already a folder there calledlocal. If there is,don’t overwrite it. In my case (and yours too), there shouldn’t be alocalfolder there initially.

14)Let’s create alocalfolder inusr:

mkdir ./localls

Verify that the contents ofusrare as before, except for the addition of the newlocalfolder we just created.

15)Iflocalhas been successfully created,cdinto it and create a folder inside it calledbin, like so:

cd localmkdir ./binls

Check that ourbinfolder is now listed under thelscommand we just sent.

16)Ifbinis listed, then we’ve successfully created the folder structure/usr/local/bin, and are ready to copy our files into it from/tmp/usr/local/bin. We can do it with the following command:

mv /tmp/usr/local/bin/* … /usr/local/bin/

As in Step 10, my system reported a “No such file or directory” error here, but worked regardless.

17)To check the copy has been successful, typecd bin, followed byls, and ensure our files (dropbearconvert,dropbearkey, and all the others you saw in Step 12, of which I had eight), are present.

If they are, then we’re all done! We’ve moved all the Dropbear-related files from/tmp, where they are periodically wiped, onto the filesystem, where they’ll be persistent. Specifically, we moved the contents of/tmp/etc/dropbearto/etc/dropbear, and the contents of/tmp/usr/local/binto/usr/local/bin.

you may now invoke SSH via Dropbear any time your Apple TV 4 is in a jailbroken state with liberTV, without worrying about SSH having been wiped and requiring another setup. Remember, to use any of the commands you’re used to, such ascd,passwd, orls, you’ll need to issue the command below once per Terminal SSH session first, or they won’t be available:

Good luck!

Do not overwrite ANY system binaries. If at any point in this guide you find an already existing version of a file on the Apple TV filesystem, do NOT overwrite it with the version from /tmp.

This should not happen, but double-check the contents of directories before copying into them, and always be sure where you currently are in the filesystem before issuing any commands from/to/in it.

Need any more help with this guide? Pleased to have a persistent SSH setup on your Apple TV 4 at last? Let me know your thoughts in the comments section…