Quitting Telnet Habit
I wanted to quit telnet and turn off devmode ( Go to the Discover tab and search the store for "devmodeoff").
This means I lose a few games and the "ForceWifiOn=true" option in [DeveloperSettings] in the /mnt/onboard/.kobo/Kobo/Kobo eReader.conf file.
But in exchange , insecure telnet doesn't start by default.
***
To help me break the habit, I will use a NickelMenu entry to call KOReader's ssh server:
menu_item :main : Dropbear (toggle) :cmd_output :500:quiet :/usr/bin/pkill -f "dropbear"
chain_success:skip:5
chain_failure :cmd_spawn :quiet :/bin/mount -t devpts | /bin/grep -q /dev/pts || { /bin/mkdir -p /dev/pts && /bin/mount -t devpts devpts /dev/pts; }
chain_success :cmd_spawn :quiet :export HOME="/mnt/onboard/.adds/koreader/" && cd "$HOME" && /mnt/onboard/.adds/koreader/scripts/dropbear -E -R -p2222 >/mnt/onboard/.adds/koreader/Dropbear.log 2>&1
chain_success :dbg_toast :Started Dropbear server on port 2222
chain_failure :dbg_toast :Error starting Dropbear server on port 2222
chain_always:skip:-1
chain_success :dbg_toast :Stopped Dropbox server on port 2222
For anyone not already aware, an advantage of ssh over telnet (besides not transmitting passwords in cleartext,lol) is using scp to transfer files from your PC to your Kobo over ssh, or vice versa.
(I access the Kobo from the PC to do both directions, so as not to be accessing my precious PC from the questionably secure Kobo).
You can use the scp command with the help of our new NickelMenu entry (if you prefer that over starting ssh from within KOReader, or installing/extracting from NiLuJe's kobostuff suite of tools package.)
To copy the file "bla.txt" from your PC to your kobo's /mnt/onboard/.adds/koreader/ directory:
$ scp -P 2222 bla.txt root@192.168.2.2:/mnt/onboard/.adds/koreader/
root@192.168.2.2's password:
bla.txt 100% 11 8.9KB/s 00:00
[root@kobo koreader]# cat bla.txt
blablabla
Make some changes to bla.txt on your Kobo and copy it back to your PC:
$ scp -P 2222 root@192.168.2.2:/mnt/onboard/.adds/koreader/bla.txt .
root@192.168.2.2's password:
bla.txt 100% 19 13.1KB/s 00:00
$ cat bla.txt
blablabla
hahaha
***
IMPORTANT NOTE: FOR SCP, THE TRAILING '/' IN /mnt/onboard/.adds/koreader/ MEANS THE CONTENTS OF THE DIRECTORY.
IF WE HAD LEFT OUT THE '/', AS IN /mnt/onboard/.adds/koreader, IT WOULD MEAN THE ENTIRE DIRECTORY /koreader !!!
***
***
This works over USB cable as well.
FOR NETWORKING (E.G. TELNET) OVER USB CABLE INSTEAD OF WIFI:
See instructions at https://www.yingtongli.me/blog/2018/...elnet-usb.html
Instead of automatically enabling it, I created a nickel menu item:
menu_item :main :USB Networking on :cmd_spawn :quiet:exec /mnt/onboard/opt/usbtoeth
chain_success :dbg_toast :Started USB networking
chain_failure :dbg_toast :Error
menu_item :main :USB Networking off :cmd_spawn :quiet:exec /mnt/onboard/opt/usbtoethd
chain_success :dbg_toast :Stopped USB networking
chain_failure :dbg_toast :Error
So to connect the Kobo with my desktop over the USB cable:
1.On Kobo, select"USB Networking on" from the nickel menu.
2.Connect the USB cable between Kobo and Desktop.
3.The network applet icon on the desktop will be a spinning progress bar, like it's trying to connect on ethernet. Click this icon and choose "disconnect".
4.On desktop terminal enter "sudo ifconfig usb0 192.168.2.1" and you will be connected.
****
I wanted to quit telnet and turn off devmode ( Go to the Discover tab and search the store for "devmodeoff").
This means I lose a few games and the "ForceWifiOn=true" option in [DeveloperSettings] in the /mnt/onboard/.kobo/Kobo/Kobo eReader.conf file.
But in exchange , insecure telnet doesn't start by default.
***
To help me break the habit, I will use a NickelMenu entry to call KOReader's ssh server:
menu_item :main : Dropbear (toggle) :cmd_output :500:quiet :/usr/bin/pkill -f "dropbear"
chain_success:skip:5
chain_failure :cmd_spawn :quiet :/bin/mount -t devpts | /bin/grep -q /dev/pts || { /bin/mkdir -p /dev/pts && /bin/mount -t devpts devpts /dev/pts; }
chain_success :cmd_spawn :quiet :export HOME="/mnt/onboard/.adds/koreader/" && cd "$HOME" && /mnt/onboard/.adds/koreader/scripts/dropbear -E -R -p2222 >/mnt/onboard/.adds/koreader/Dropbear.log 2>&1
chain_success :dbg_toast :Started Dropbear server on port 2222
chain_failure :dbg_toast :Error starting Dropbear server on port 2222
chain_always:skip:-1
chain_success :dbg_toast :Stopped Dropbox server on port 2222
For anyone not already aware, an advantage of ssh over telnet (besides not transmitting passwords in cleartext,lol) is using scp to transfer files from your PC to your Kobo over ssh, or vice versa.
(I access the Kobo from the PC to do both directions, so as not to be accessing my precious PC from the questionably secure Kobo).
You can use the scp command with the help of our new NickelMenu entry (if you prefer that over starting ssh from within KOReader, or installing/extracting from NiLuJe's kobostuff suite of tools package.)
To copy the file "bla.txt" from your PC to your kobo's /mnt/onboard/.adds/koreader/ directory:
$ scp -P 2222 bla.txt root@192.168.2.2:/mnt/onboard/.adds/koreader/
root@192.168.2.2's password:
bla.txt 100% 11 8.9KB/s 00:00
[root@kobo koreader]# cat bla.txt
blablabla
Make some changes to bla.txt on your Kobo and copy it back to your PC:
$ scp -P 2222 root@192.168.2.2:/mnt/onboard/.adds/koreader/bla.txt .
root@192.168.2.2's password:
bla.txt 100% 19 13.1KB/s 00:00
$ cat bla.txt
blablabla
hahaha
***
IMPORTANT NOTE: FOR SCP, THE TRAILING '/' IN /mnt/onboard/.adds/koreader/ MEANS THE CONTENTS OF THE DIRECTORY.
IF WE HAD LEFT OUT THE '/', AS IN /mnt/onboard/.adds/koreader, IT WOULD MEAN THE ENTIRE DIRECTORY /koreader !!!
***
***
This works over USB cable as well.
FOR NETWORKING (E.G. TELNET) OVER USB CABLE INSTEAD OF WIFI:
See instructions at https://www.yingtongli.me/blog/2018/...elnet-usb.html
Instead of automatically enabling it, I created a nickel menu item:
menu_item :main :USB Networking on :cmd_spawn :quiet:exec /mnt/onboard/opt/usbtoeth
chain_success :dbg_toast :Started USB networking
chain_failure :dbg_toast :Error
menu_item :main :USB Networking off :cmd_spawn :quiet:exec /mnt/onboard/opt/usbtoethd
chain_success :dbg_toast :Stopped USB networking
chain_failure :dbg_toast :Error
So to connect the Kobo with my desktop over the USB cable:
1.On Kobo, select"USB Networking on" from the nickel menu.
2.Connect the USB cable between Kobo and Desktop.
3.The network applet icon on the desktop will be a spinning progress bar, like it's trying to connect on ethernet. Click this icon and choose "disconnect".
4.On desktop terminal enter "sudo ifconfig usb0 192.168.2.1" and you will be connected.
****