MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Kindle Developer's Corner (https://www.mobileread.com/forums/forumdisplay.php?f=150)
-   -   K4NT not reachable by SSH (https://www.mobileread.com/forums/showthread.php?t=188479)

zer0 08-19-2012 06:48 PM

K4NT not reachable by SSH
 
The recently got K4 is not reachable via SSH (192.168.15.244 refused connection from PuTTY).

I'm using the simplest "ENABLE_DIAGS" file to usable USBNet.

Here are the diagnosis.
  1. 192.168.15.1 is reachable by ping
  2. 192.168.15.244 is reachable by ping
  3. Using "nmap 192.168.15.0/24", only one host is up (192.168.15.1). It has a 22 port open, but still refused connection from PuTTY

qlob 08-19-2012 06:53 PM

Quote:

Originally Posted by zer0 (Post 2190635)
The recently got K4 is not reachable via SSH (192.168.15.244 refused connection from PuTTY).

I'm using the simplest "ENABLE_DIAGS" file to usable USBNet.

Here are the diagnosis.
  1. 192.168.15.1 is reachable by ping
  2. 192.168.15.244 is reachable by ping
  3. Using "nmap 192.168.15.0/24", only one host is up (192.168.15.1). It has a 22 port open, but still refused connection from PuTTY

I'm not a K4 user, but here are my guesses:
192.168.15.1 is yourself. I made this mistake as well. Only 192.168.15.244 is the kindle.
Also, I remember seeing that you have to set the IP address from your computer at 192.168.15.201 because that is the way diags is configured...

knc1 08-19-2012 06:57 PM

Quote:

Originally Posted by zer0 (Post 2190635)
The recently got K4 is not reachable via SSH (192.168.15.244 refused connection from PuTTY).

I'm using the simplest "ENABLE_DIAGS" file to usable USBNet.

Here are the diagnosis.
  1. 192.168.15.1 is reachable by ping
  2. 192.168.15.244 is reachable by ping
  3. Using "nmap 192.168.15.0/24", only one host is up (192.168.15.1). It has a 22 port open, but still refused connection from PuTTY

PuTTY == Windows, correct? Yeah, like it might be something else.

The combination of #1 and #2 does not equal the report of #3.
nmap must have reported more than just what is written above.

If 192.168.15.1 has port 22 open (sshd) try connecting to it. Find out if your talking to yourself or the Kindle.

zer0 08-19-2012 07:46 PM

Thanks for the replies. Indeed I'm using Windows.

192.168.15.1 or 192.168.15.201 have the same results.

1. Both of them are actually myself, not the kindle.
2. 192.168.15.244 is reachable from ping.

Logs of nmap:
Code:

F:\doc>nmap 192.168.15.244/32

Starting Nmap 6.01 ( http://nmap.org ) at 2012-08-19 18:44 Eastern Daylight Time
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 0.86 seconds

Log of ipconfig/all

Code:

Ethernet adapter Local Area Connection 2:

  Connection-specific DNS Suffix  . :
  Description . . . . . . . . . . . : USB Ethernet/RNDIS Gadget
  Physical Address. . . . . . . . . : EE-29-00-00-00-15
  DHCP Enabled. . . . . . . . . . . : No
  Autoconfiguration Enabled . . . . : Yes
  Link-local IPv6 Address . . . . . : fe80::4cb1:4c8b:2d63:176b%24(Preferred)
  IPv4 Address. . . . . . . . . . . : 192.168.15.201(Preferred)
  Subnet Mask . . . . . . . . . . . : 255.255.255.0
  Default Gateway . . . . . . . . . :
  DHCPv6 IAID . . . . . . . . . . . : 418261248
  DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-14-B1-D0-C7-00-1C-25-9A-C8-B2
  DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                      fec0:0:0:ffff::2%1
                                      fec0:0:0:ffff::3%1
  NetBIOS over Tcpip. . . . . . . . : Enabled


knc1 08-19-2012 07:56 PM

I can't tell you anything more than what the reports already have said: sshd is not running on the Kindle.
Start sshd (known as Dropbear) on the Kindle.

zer0 08-20-2012 04:13 PM

Does it mean that I need to use the flashing/dd partition procedures to copy/install sshd in the K4?

hippy dave 08-20-2012 04:25 PM

i followed the Gaining root access and Enable ssh access through wifi sections of the k4 wiki, worked perfectly. your post doesn't say exactly which steps you've taken, but the first link should hopefully get you connected via usb when in diagnostic mode, and the second (which includes copying dropbear from diagnostic to main) should get you connected via wifi when in normal (not diagnostic) mode.

zer0 08-21-2012 08:45 PM

Successfully flash the kindle to the 4.0 FW. My guess is that the new 4.1 version deletes the sshd. Thanks for pointing out the problems and the useful tips in the previous debricking threads, especially the thread about installing libusb in win7 64.

hippy dave 08-21-2012 10:41 PM

when i did mine, it had already updated to 4.1, i don't know what effect the update process would have had if it had already been hacked.

twobob 08-22-2012 08:13 AM

HOME > MENU > SETTINGS > type 711 (for a kindle 3)

Quote:

Originally Posted by hippy dave (Post 2193662)
to get the 711 page on a k4, go to the settings page, then hold the keyboard button & press the right-side next-page button.

Then try telnetting from your machine

(I forget what the windows 7 cmd prompt looks like so I made it up, here)

YourMachine: telnet (the ip from 711) 22 - so like telnet 192.168.1.244 22

you should get
Trying 192.168.1.244...
Connected to 192.168.1.244.
Escape character is '^]'.

This is just a sanity test that it IS actually there.

Ping is blocked by default IIRC. and while this WON'T get you in via ssh at least you will know your not going mad.

If that works you can confidently say "Well the port *is* open".



A typical 3 iptables is below

[root@kindle us]# clear && iptables --line-numbers -L -n -v
Code:

Chain INPUT (policy DROP 3690 packets, 254K bytes)
num  pkts bytes target    prot opt in    out    source              destination       
1        0    0 ACCEPT    tcp  --  ppp0  *      0.0.0.0/0            0.0.0.0/0          tcp dpt:40317 (trojan port via 3g)
2        0    0 ACCEPT    tcp  --  ppp0  *      0.0.0.0/0            0.0.0.0/0          state RELATED,ESTABLISHED
3    60676  53M ACCEPT    tcp  --  wlan0  *      0.0.0.0/0            0.0.0.0/0          state RELATED,ESTABLISHED (its our wirelss connection)
4      198 48645 ACCEPT    udp  --  wlan0  *      0.0.0.0/0            0.0.0.0/0          state ESTABLISHED (wireless udp)
5        5  384 ACCEPT    udp  --  ppp0  *      0.0.0.0/0            0.0.0.0/0          state ESTABLISHED (udp for the 3g)
6    2365  170K ACCEPT    all  --  lo    *      127.0.0.1            0.0.0.0/0  (localstuff is ok)       
7      937  307K ACCEPT    all  --  usb0  *      0.0.0.0/0            0.0.0.0/0  (usb waiting to work)       
8    16559 1466K ACCEPT    icmp --  *      *      0.0.0.0/0            0.0.0.0/0          state RELATED,ESTABLISHED  (This is the INPUT CHAIN mind. it doesn't reply, probably stealthed)
9      10  536 ACCEPT    tcp  --  wlan0  *      0.0.0.0/0            0.0.0.0/0          tcp dpt:22 (and last but not least SSH : ) )

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num  pkts bytes target    prot opt in    out    source              destination       
(nothing, thankfully)

Chain OUTPUT (policy ACCEPT 72669 packets, 9433K bytes)
num  pkts bytes target    prot opt in    out    source              destination       
1    2365  170K ACCEPT    all  --  *      lo      0.0.0.0/0            127.0.0.1   
(allow everything to happen locally)

HIGHLY ANNOYINGLY (on a side point)

tail -f /var/log/messages has this to say about Settings 711


Code:

input=********* 1- Connection *********
120822:120816 cvm[3847]: 1.1 MAC: xx:EF:99:89:17:xx
120822:120816 cvm[3847]: 1.2 Wireless: On(1)
120822:120816 cvm[3847]: 1.3 AP: MoneyHole (00:36:9b:99:9a:99)
120822:120816 cvm[3847]: 1.3.1  Signal strength: 5/5
120822:120816 cvm[3847]: 1.3.2  Captive: no
120822:120816 cvm[3847]: 1.3.3  Security: WPA2-PSK
120822:120816 cvm[3847]: 1.3.4  Channel: 99
120822:120816 cvm[3847]: 1.6 Country: <unknown>
120822:120816 cvm[3847]:
120822:120816 cvm[3847]: ********* 2- Wireless Configuration *********
120822:120816 cvm[3847]: 2.1  Belkin_0CDD999 0        [WPA2-PSK][TKIP][CCMP]        (1)       
120822:120816 cvm[3847]: 2.2  MoneyHole        1        [WPA2-PSK][CCMP]        (4)       
120822:120816 cvm[3847]: 2.3  NortonArmsWifi        2        [WPA2-PSK][TKIP][CCMP]        (1)       
120822:120816 cvm[3847]:
120822:120816 cvm[3847]: ********* 3- Interface Configuration *********
120822:120816 cvm[3847]: 3.1 IP Address: 192.168.1.99
120822:120816 cvm[3847]: 3.2 Netmask  : 255.255.255.0
120822:120816 cvm[3847]: 3.3 Broadcast :
120822:120816 cvm[3847]: 3.4 Gateway  : 192.168.1.257
120822:120816 cvm[3847]: 3.5 Config    : DHCP
120822:120816 cvm[3847]: 3.6 DNS      : 192.168.1.257,
120822:120816 cvm[3847]: 3.7 Sponsored    : no
120822:120816 cvm[3847]:
120822:120816 cvm[3847]: ********* 4- Last DHCP Session *********
120822:120816 cvm[3847]: Sending discover...
120822:120816 cvm[3847]: Offer from server xxx.xxx.1.257 received
120822:120816 cvm[3847]: Sending select for xxx.xxx.1.99...
120822:120816 cvm[3847]: Lease of xxx.xxx.1.99 obtained, lease time 86400
120822:120816 cvm[3847]:
120822:120816 cvm[3847]: 5 Device Time: Wed Aug 22 12:08:16 2012
120822:120816 cvm[3847]:
120822:120816 cvm[3847]: , focus=TRUE

Hmm seems a bit OTT to record my MAC addresses, but meh.

In essence if you can get into your device via USB perhaps you could dredge something from the guts to help you find out the issue.

HTH. :\

knc1 08-22-2012 08:50 AM

There is something wrong in that 711 report -
Look at the DNS and Gateway addresses.

Either:
Hand edited to fake IP address ;
The report is wrong ;
The setup is wrong ;

The value 257 can not be expressed in 8 bits, 0 ... 255 is all you can represent with only 8 bits.

- - - - -

The default policy of the input chain is "drop" - -

If you do want telnet to always work, open port 23 (just like the entry made for port 22).

If you want Samba and mod SMB to work, you will need to open at least port 445.
Very likely you will have to open the netbios control ports also (137, 138, 139).

Note: All of the assigned, common, ports are listed in your /etc/services file (Kindle, *nix, Windows (yes, even Windows has an etc directory), ...)

Hmm...
We built mod SMB but I don't recall seeing that we build the Samba application.
More Buildroot diddling required or just build it outside of Buildroot with the cross tool chain?
I would expect Samba to be cross-compile friendly.

Some of my earlier postings where a bit confused about that, but we do need more than just the kernel module.

twobob 08-22-2012 09:21 AM

I mungled to output. I put on obviously fake answers. I usually just go with 99.99.99.99 but I was feeling adventurous.

I'll look at the samba stuff now then. then your magic numbers binfrmt wangle.

Best of luck with the ssh'ing OP!!!

In my experience I would suggest you check your firewall settings in windows.

EVEN BETTER: turn it off.

: )

hippy dave 08-22-2012 10:27 AM

to get the 711 page on a k4, go to the settings page, then hold the keyboard button & press the right-side next-page button.

twobob 08-22-2012 12:41 PM

thanks dave. :)

hippy dave 08-22-2012 03:22 PM

welcome :)


All times are GMT -4. The time now is 10:15 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.