View Single Post
Old 02-29-2016, 09:26 PM   #11
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
You must have KUAL installed (being this is the newest and greatest Amazon firmware) . . . .

Did you install the "Helper" extension?
I am pretty sure that is the one with the 411 and/or 711 buttons.

Let me see now ...
My PW-3 is still on its factory initial (5.6.1.1) firmware, but a lot of these things have remained the same ...

Home -> Search -> enter: ;711
The semi-colon is part of the command -> ;711
Screen shot attached, with 'airplane mode' enabled, USBnet disabled.

First - lets get everything working - you can customize the numbers **LATER**.

You can connect to the Kindle over two media -
The USB cable and/or the Wifi connection.

We do the USB cable way first, because it works 'out of the box' if you have not modified its configuration file.
(If you have, modify it back - we will tackle one challange at a time.)

What are you going to USB cable the Kindle to?
Keep it simple - plan on using a pc (Linux or MacOSx - Windows someone will have to translate - but what you already wrote is probably 'close enough').

remove USB cable !!!

KUAL -> USBnetwork -> (Query) USBnetwork Status
Bottom line should say "usb network disabled, sshd down"

KUAL -> USBnetwork -> (Action) Toggle USBnetwork
Wait a few - check status again - it should report that it is up.

Connect Kindle to PC with the USB cable.

Note on the PC:
Code:
core2quad ~ $ dmesg
[179743.220126] usb 2-3.5: new high speed USB device number 14 using ehci_hcd
[179743.526179] cdc_subset: probe of 2-3.5:1.0 failed with error -22
[179743.528136] cdc_subset 2-3.5:1.1: usb0: register 'cdc_subset' at usb-0000:00:1d.7-3.5, Linux Device, 22:6e:e3:00:56:b8
[179743.528198] cdc_ether: probe of 2-3.5:1.0 failed with error -16
[179743.528222] usbcore: registered new interface driver cdc_ether
[179743.528568] usbcore: registered new interface driver cdc_subset
Only the last two lines are significant - the rest was just the PC's kernel getting itself organized.

I have been doing this for awhile now, so I have a clause set in my PC's /etc/network/interfaces file that looks like this:
Code:
core2quad ~ $ cat /etc/network/interfaces

- - - -

iface usb0:1 inet static
        address 192.168.15.201
        netmask 255.255.0.0
        network 192.168.15.0
So when I invoke that clause . . . .
Code:
core2quad ~ $ sudo ifup usb0:1
ssh stop/waiting
ssh start/running, process 11037
Note that the two lines of output there refer to sshd on my PC - which is not involved in USBnetworking with the Kindle.

Now, the PC end of the cable has IP address: 192.168.15.201
Code:
core2quad ~ $ ip addr
- - - -
4: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 22:6e:e3:00:56:b8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.15.201/16 scope global usb0:1
    inet6 fe80::206e:e3ff:fe00:56b8/64 scope link 
       valid_lft forever preferred_lft forever
This Linux distribution does the same as most, it pokes in a route based on the interfaces clause that was invoked:
Code:
core2quad ~ $ ip route
default via 192.168.0.1 dev eth0  metric 100 
169.254.0.0/16 dev eth2  proto kernel  scope link  src 169.254.57.30 
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.2 
192.168.0.0/16 dev usb0  proto kernel  scope link  src 192.168.15.201
(The last route was just added to the PC's end of the USB cable.)
The PC is indeed 192.168.15.201 and any packet address that fits the 102.168.0.0/16 pattern will be sent to device USB0.

Since I have a serial port connection to the Kindle also, I can show what that end of the USB cable looks like:
Code:
[root@kindle bin]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo

2: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether ee:19:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.15.244/24 brd 192.168.15.255 scope global usb0

[root@kindle bin]# ip route
192.168.15.0/24 dev usb0  src 192.168.15.244
Sure enough, just like the USBnetwork config file on the Kindle said, the Kindle end of the USB cable (not the Kindle, the Kindle end of the USB cable) is 192.168.15.244

Check the Kindle's firewall, see if it will allow our packets in:
Code:
[root@kindle bin]# iptables -L
Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:40317
ACCEPT     tcp  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     udp  --  anywhere             anywhere             state ESTABLISHED
ACCEPT     udp  --  anywhere             anywhere             state ESTABLISHED
ACCEPT     udp  --  anywhere             anywhere             udp spt:40317
ACCEPT     udp  --  anywhere             anywhere             udp spt:49317
ACCEPT     udp  --  anywhere             anywhere             udp spt:33434
ACCEPT     all  --  localhost.localdomain  anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     icmp --  anywhere             anywhere             state RELATED,ESTABLISHED

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             localhost.localdomain
Answer: Yes (lines 10 and 2)

Is sshd really running?
Code:
[root@kindle bin]# ps aux | grep ssh
root      20394  0.0  0.1   2488   528 ?        SNs  20:37   0:00  /usr/bin/dropbear -P /mnt/us/usbnet/run/sshd.pid -K 15 -n -b /dev/null
Yes.
Note that the default sshd server is DropBear - the OpenBSD sshd is an option in the config file.

Back on the PC (not to get too confusing, but the PW-3 and my PC are both running the same version of Linux ) - -

I do this often enough that I gave the Kindle's end of the USB cable's address a name:
Code:
core2quad ~ $ cat /etc/hosts
127.0.0.1               localhost
192.168.15.244    ken1.morethan.org    ken1
- - - - -
To simplify things further (and because the version of ssh keyring can not handle the number of keys I have on my PC) . . . .

I have added a short-cut clause to the ~/.ssh/config file of my PC:
Code:
- - - - - -
host kpw
     user root
     hostname ken1.morethan.org
     port 22
     IdentitiesOnly yes
     identityfile ~/.ssh/kpw_id_rsa
- - - - - -
And note: I do not have a passphrase on that private key file (I use the over-all security features of my PC instead).
The next to last option: "IdentitiesOnly yes" in the config file forces my ssh client to try **ONLY** the specified key file.

Now with all of that setup - to get an ssh connection from my PC to the Kindle, I enter:
Code:
core2quad ~ $ ssh kpw
#################################################
#  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.
#################################################
Note:
The same 'kpw' shortcut name works also with scp and sftp.

Whoot!
It does work.

Better details at:
https://www.mobileread.com/forums/sho...d.php?t=204450
https://www.mobileread.com/forums/sho...d.php?t=204676
https://www.mobileread.com/forums/sho...d.php?t=204942
https://www.mobileread.com/forums/sho...d.php?t=205068
https://www.mobileread.com/forums/sho...d.php?t=205224
https://www.mobileread.com/forums/sho...d.php?t=201572 (Mac OSx)
Attached Thumbnails
Click image for larger version

Name:	screenshot_711.png
Views:	424
Size:	26.2 KB
ID:	146799  

Last edited by knc1; 02-29-2016 at 09:47 PM.
knc1 is offline   Reply With Quote