This enables you to connect to your Kindle via SSH using USB connection. With some further settings, you can SSH with WiFi.
Prerequisites
- You have a jailbroken Kindle. If not, you can refer to this post.
- Both KUAL and MRPI are installed. If not, refer to this post.
Installing
- Go to the Snapshots page on MobileRead.
- Under the right product category, find the USBNetwork Hack. Download the
.tar.xz
file. - Extract the downloaded file, select the correct
Update_usbnet_*.bin
file. There are multiple update files for different devices, so make sure you select the correct one! - Connect your Kindle to your computer via USB cable. Confirm it’s in USB Drive Mode.
- Place the selected file in Step 3 in
/mrpackage/
under your Kindle’s root folder. - Disconnect Kindle from the computer.
- Go to
KUAL--Helper--Install MR Packages
, install theUSBNetwork
.
SSH via USB
After installing by default, this is the only possible way to connect. Depending on the OS, some of the following steps can differ:
- Turn on the SSH server on the Kindle by typing
;un
in the search bar then pressEnter
. This will start the server with its IP as192.168.15.244
which expects a incoming connection from192.168.15.201
. - Configure the network on the client side:
- macOS:
System Settings--Network--RNDIS/Ethernet Gadget--Details--TCP/IP
Configure IPv4
:Manually
IP Address: 192.168.15.201
Subnet Mask: 255.255.255.0
- The red dot indicating the network should turn green
- Linux:
ifconfig usb0 192.168.15.201
- Windows: Please check the Windows section of this post.
- macOS:
- Connecting to server:
ssh root@192.168.15.244
. No password, so just pressEnter
.
SSH via WiFi
Now that you have the remote access to your Kindle, you can also turn on the SSH connection via WiFi. There are two reasons that you might want to do this:
- The connecting is easier as you don’t have to do the plugging and unplugging.
- It might be easier for the debugging as the Kindle being charged while connecting via USB might influence some system behaviors which make the debugging difficult.
This can be enabled by:
- Change
USE_WIFI
option toTRUE
for/mnt/us/usbnet/etc/config
- Restart SSH server in KUAL
Then disconnecting the Kindle from the computer, the server can be accessed by ssh root@YourKindle'sIP
(usually it’s 192.168.0|1.x
).
Some tidying up
Some of the below are not closely related to SSH but they become a problem once SSH connection is possible.
Start SSH service on boot
- SSH into Kindle
touch /mnt/us/usbnet/auto
Show logs while starting Kindle
- SSH into Kindle
touch /mnt/us/usbnet/verbose
This will show some logs at the bottom of the screen while Kindle is starting.
Give Kindle a static IP
If you want to use SSH via WiFi consistently, it is recommended to use DHCP to give Kindle a static local IP. This can be achieved by a router.
Set a password for root
user
root
This is a major security risk with incoming SSH connection. Essentially without password anyone within your LAN has the access to your Kindle.
- SSH into Kindle
passwd
, then enter your new password
Attention, next time when you want to Ssh into your Kindle, you should use the newly-set password.
Use pub key authentication
This is more convenient and securer than a password login. The steps are below:
- Run
ssh-keygen
on your client machine. Enter the name you would like it to have. In the end it gives you a private keyxxx
and a public keyxxx.pub
. - Copy the
xxx.pub
to/mnt/us/usbnet/etc/
usingscp
, rename it toauthorized_keys
- Copy
xxx
to the.ssh
folder on your client machine.
Now you should be able to connect your Kindle with pub key authentication.
Some more tweaks
Similar as the SSH
service on another Linux machine, there exists a sshd
config file in Kindle’s system (/mnt/us/usbnet/etc/sshd_config)
. There you can do things like turning off password login, restrict login IPs and adjusting port etc.
Closing remarks
Connecting to Kindle via SSH
to be honest is not that straightforward comparing to other Linux machines. However, this is not all impossible by following the previously mentioned steps. This exposes the system files to us and make possible further tweaking of the system via scripting.
1 Response
[…] […]