Kindle touch with ssh to wi-fi enabled

Lately, I’ve spent quite a lot of time playing with my Kindle. The motivation was mostly its sloppiness – after having it for 1.5 year, my Kindle became very slow and unresponsive… I decided to factory reset it. And while doing it, I’ve checked if I maybe the jailbreak of newer firmware is possible (last time I’ve checked over a year ago it wasn’t).
To my big joy, I found these days it’s fairly easy to jailbreak any kindle by downgrading it’s firmware.
But this isn’t the focus of this post. Here I would like to share my experience with enabling ssh access to my Kindle. Why anyone would do that? Kindle is ARM-processor powered computer with Linux installed. So having SSH access, you can setup your Kindle to do lots of useful stuff. But about that, I’ll write in the next posts 😉
Here is how to proceed:

  1. Jailbreak your Kindle
  2. Install KUAL & Mobileread Package Installer (MrPI)
  3. Install USBNetwork Hack
  4. Create new user account in Kindle for SSH access
  5. # get dev name from udev
    dmesg | grep usb0
    
    # bind
    sudo ifconfig enp0s20u8 192.168.15.201
    
    # telnet
    telnet 192.168.15.244
    
    # mount root with write access
    mntroot rw
    
    # create new user
    mkdir -p /home
    adduser USER
    
    # make it root by changing USERID to 0 in <code>/etc/passwd</code> ie. 
    USER:x:0:0:root,,,:/home/USER:/bin/sh
    
    
  6. Start sshd and enable port 22 for SSH temporarily
  7. This is only to check if SSH is possible. So far we didn’t make any serious changes 😉

    /mnt/us/usbnet/sbin/sshd -f /mnt/us/usbnet/etc/sshd_config
    iptables -A INPUT -p tcp --dport 22 -j ACCEPT
    

    Now try to login to your Kindle by SSH. You can find its IP by executing ifconfig. Proceed only if SSH works for you.

  8. Enable port 22 for SSH
  9. # add below line to <code>/etc/sysconfig/iptables</code> to enable SSH access
    -A INPUT -p tcp --dport 22 -j ACCEPT
    
  10. Add sshd to upstart
  11. Create new file /etc/upstart/sshd.conf

    # ssh - OpenBSD Secure Shell server
    #
    # The OpenSSH server provides secure shell access to the system.
    
    env LOGFILE=/tmp/ssh.log
    
    description     "OpenSSH server"
    
    start on dbus_ready
    stop on stopping dbus
    
    respawn limit 2 5
    umask 022
    
    pre-start script
        test -x /usr/sbin/sshd || { stop; exit 0; }
        test -e /etc/ssh/sshd_not_to_be_run && { stop; exit 0; }
        test -c /dev/null || { stop; exit 0; }
    end script
    
    script
        # if you used to set SSHD_OPTS in /etc/default/ssh, you can change the
        # 'exec' line here instead
        echo `date` "Starting sshd..." >> $LOGFILE 2>&1
        /mnt/us/usbnet/sbin/sshd -f /mnt/us/usbnet/etc/sshd_config >> $LOGFILE 2>&1
    end script
    
  12. Disable auto updates
  13. mv /etc/uks /etc/uks.disabled
    

Now SSH should work after Kindle reboot 🙂

Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *