ssh (or telnet) on the Kobo Glo
The Kobo Glo is a very nice device, but it lacks besides other things the ability to make screen shots. And it does not have an ssh or telnet server activated, so you cannot log onto this device and do changes deep in the system. This article describes how to install and setup an ssh server on the device, which in turn will also allow to do screen shots.
Warning: This is not for the faint of heart, you can easily can come into the situation that your device is unbootable. So keep a backup of the original firmware sd card, as described in this article. Also keep in mind that the descriptions here are for people who know how to operate a unix command line.
The following descriptions are based on this guide.
We first activate a telnet and ssh server on the device, then use telnet to log into the device and change a few things (root password, root home directory). After that ssh-ing into the device should work. After getting ssh to work, we disable the telnet again.
As described in this article, the kobohack-j project ships an ssh server (dropbear) and a sftp server (openssh). So the best is to follow the upgrade guide given here.
If you do not want to install all of the kobohack parts, at least it is necessary to install the KoboRoot_hack.tgz by copying it to the directory KOBOeReader/.kobo/KoboRoot.tgz (where KOBOeReader refers to the mount point of your device). After that restart as usual.
In the following some items will be marked with (ON THE GLO) meaning that they should be carried out while logged into the device, not on your main computer. For those items I have also indicated a prompt that is given by the Kobo Glo:
[root@(none) ~]# which should not be typed in.
- Create a working directory KoboRoot and necessary sub-directories
create a new directory KoboRoot (empty) and within that the following directories: etc and etc/init.d, i.e.,
mkdir -p KoboRoot/etc/init.d
- Getting hold of /etc/inittab:
WARNING: the safest method is to extract the SD card, mount the rootfs, and copy the following file /etc/inittab. If this is not an option, one can use, on one’s own risk the file mentioned below. I don’t know how often Kobo changes these files, but I haven’t seen any change since I own the device. Put the file into the working directory KoboRoot/etc/inittab.
- adaption KoboRoot/etc/inittab:
one has to add two lines:
::respawn:/usr/sbin/inetd -f /etc/inetd.conf.local
If you got hold of the file from your device, just add these two lines, otherwise one could use the following content:
# This is run first except when booting in single-user mode.
::respawn:/sbin/getty -L ttymxc0 115200 vt100
::shutdown:/bin/umount -a -r
::respawn:/usr/sbin/inetd -f /etc/inetd.conf.local
- creation of KoboRoot/etc/init.d/rcS2
this is a new file with the following content:
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts
make sure that this file is also executable
chmod a+x KoboRoot/etc/init.d/rcS2
- creation of KoboRoot/etc/inetd.conf.local
Create a the inetd.conf.local file with the following content:
22 stream tcp nowait root /bin/dropbearmulti dropbear -i -B
23 stream tcp nowait root /bin/busybox telnetd -i
- create a new KoboHack.tgz
tar -cvzf KoboRoot.tgz -C KoboRoot .
- copy new KoboRoot.tgz to KOBOeReader/.kobo/
- reboot reader, it should show “Updating …”
- Turn on Wifi on the Kobo and find IP address
Go to Settings – Connect and after this is done, go to Settings – Device Information where you will see something like
IP Address: 192.168.1.NN
- telnet into your device
it will ask you the user name, enter “root” (without the quotes) and no password
- (ON THE GLO) change home directory of root
edit /etc/passwd with vi and change the entry for root by changing the 6th field from: “/” to “/root” (without the quotes). After this procedure the line should look like
don’t forget to save the file
- (ON THE GLO) create ssh keys for dropbear
[root@(none) ~]# mkdir /etc/dropbear
[root@(none) ~]# cd /etc/dropbear
[root@(none) ~]# dropbearkey -t dss -f dropbear_dss_host_key
[root@(none) ~]# dropbearkey -t rsa -f dropbear_rsa_host_key
- (ON YOUR PERSONAL COMPUTER) check that you can log in with ssh
You should get dropped into your device again
- (ON THE GLO) log out of the telnet session (the first one you did)
[root@(none) ~]# exit
- (ON THE GLO) in your ssh session, change the password of root
[root@(none) ~]# passwd
you will have to enter the new password two times. Remember it well, you will not be easily able to recover it without opening your device.
- (ON THE GLO) disable telnet login
edit the file /etc/inetd.conf.local on the GLO (using vi) and remove the telnet line (the line starting with 23).
- restart your device
From now on you should always be able to log into your device with ssh using a password.
Thanks, very useful!
Works perfectly on my Glo.
Work on Kbo Glo HD fw 3.15.0
Thanks Roberto, and it also works on Kobo Glo 3.16 – I only would like to get my hand on a Kobo Glo HD, but they are not selling them in Japan by now …. anyone wants to send me one from abroad? 😉
Thank you Norbert, it works fine on Kobo Glo HD 3.19.5761. Now I can copy books to the device via WinSCP. But to refresh Kobo library after the copying you have to apply the trick described here (see the bottom of that post from the words “But now the really good news:”).