Kindle 3 — changing the root password for SSH via WiFi

This post summarises the steps I used to change the root ssh password and enable ssh access over 802.11/WiFi on my jailbroken Kindle 3.

Enabling root access

The K3 starts with an unknown root password which we’d need to know if attempting to ssh in over WiFi. The trick to making this password known is to set up USB networking, login over the USB link, re-mount the filesystem readw-write (rw), then use passwd to change root’s password.

Supply an empty password to first ssh into the K3 as root over the USB network link.

[gja@gjadesktop]/home/gja(103)% ssh root@192.168.2.2

Welcome to Kindle!

root@192.168.2.2's password:
#################################################
#  N O T I C E  *  N O T I C E  *  N O T I C E  #
#################################################
Rootfs is mounted read-only. Invoke mntroot rw to
switch back to a writable rootfs.
#################################################
[root@kindle root]#

The password file on the “rootfs” file system (mounted on /dev/root), which by default is mounted read-only (ro).

[root@kindle root]# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext3 (ro,noatime,nodiratime,data=ordered)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /dev type tmpfs (rw,mode=755)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
rwfs on /mnt/rwfs type tmpfs (rw,size=32768k)
shm on /dev/shm type tmpfs (rw)
rwfs on /var type tmpfs (rw,size=32768k)
/dev/mmcblk0p2 on /var/local type ext3 (rw,sync,errors=continue,data=ordered)
fsp on /mnt/us type fuse.fsp (rw,nosuid,nodev,noatime,user_id=0,group_id=0)
/dev/loop/0 on /mnt/base-us type vfat (rw,noexec,noatime,nodiratime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8)
[root@kindle root]#

Use the “mntroot” command to re-mount the root file system in read-write (rw) mode.

[root@kindle root]# mntroot rw
system: I mntroot:def:Making root filesystem writeable
[root@kindle root]#

/dev/root is now “rw”:

[root@kindle root]# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext3 (rw,noatime,nodiratime,data=ordered)
[...]
[root@kindle root]#

I used ‘passwd’ to change root’s password to “xxxxx”, then make things safe again by restoring the root file system to read-only mode:

[root@kindle init.d]# mntroot ro
system: I mntroot:def:Making root filesystem read-only
[root@kindle init.d]#

Enabling SSH into the K3 via WiFi

The K3’s WiFi interface uses DHCP to request a valid local IP address from whatever WiFi network (SSID) you’ve configured the K3 to use.  (The K3 enables you to scan for local WiFi networks, and then provide the authentication key/password for which ever network/SSID you chose.) In factory-default form the K3’s WiFi interface is only used to access the Amazon online shop and rudimentary web access using the experimental browser.

Fortunately, in addition to settings for the IP addresses at either end of the USB network link, the configuration file /usbnet/etc/config contains a flag to enable SSH access over the WiFi interface whenever both usbNetwork and WiFi are enabled:

K3_WIFI="true"

With this option set “true”, you can SSH in to the K3’s DHCP-assigned IP address over WiFi — but you will require the root password that we set above.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: