![]() |
#1 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 23
Karma: 22222
Join Date: Oct 2010
Device: kindle3
|
Kindle Terminal app (sort of)
One way to run a shell on a kindle is to use the browser as the user interface, and a server side process that forks the shells and talks to the browser.
There are several such options around. Ajaxterm is one that seemed reasonably simple and well designed, though the original version had the server implemented in Python (so a bit too heavyweight for the Kindle). At http://info.iet.unipi.it/~luigi/kindle/ you can find a rewrite of AjaxTerm which is suitable for operation on the Kindle (but not only there). The server side has been completely rewritten in C (single source file, approx 900 lines), and the client side is only about 400 lines of javascript and no external framework or libraries. Consider the current version as a proof of concept, but it is already in reasonable shape and shouldn't take much work to add the missing features. cheers luigi |
![]() |
![]() |
![]() |
#2 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45
Karma: 14412
Join Date: Oct 2010
Location: Spain
Device: Kindle 3 - 3G
|
Good work Luigi. Have you seen Neftaly's hack? It it the beginning of a bookmarklet manager for the k3 browser. It runs a BusyBox server to do some of its magic though https://www.mobileread.com/forums/sho...d.php?t=101705
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
|
Hi. Is there way how to login with private key? I have dropbear in "K3_WIFI" mode and password for root is unknown. Or how to get root password without changing it?
|
![]() |
![]() |
![]() |
#4 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@centaurian: Yes, check the latest usbnet README & badbob001's post.
|
![]() |
![]() |
![]() |
#5 |
Member
![]() Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
|
Yes, with Putty and WinSCP it works great over Wifi with private key. Problem is how to use this tool and have usbnet with Wifi option enabled. Any idea how to do that without changing root password? I actually have last usbnet (28).
Possible solutions: 1/ change root password and login with that (that is not really what I want) 2/ find right root password (impossible?) 3/ reprogram AjaxTerm to login with private key 4/ reprogram dropbear to allow login from localhost without checking password 5/ set K3_WIFI="false" (that is not really what I want) 6/ some other way :-) Last edited by centaurian; 11-06-2010 at 08:03 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@centaurian: Oh, you mean a passwordless login *on the Kindle* via the aforementioned AjaxTerm?
In that case, if it currently does require the root password, err, yeah, sorry, since I don't use it, I can't say much more than what you already thought about ![]() I'd go with switching the root password, because tweaking usbnet to make dropbear allow passwordless logins over WiFi is a *very bad* idea ![]() Bear in mind, I haven't tried this: but why would you ssh to localhost in the first place? Doesn't AjaxTerm already drops you in a local root shell? |
![]() |
![]() |
![]() |
#7 | ||
Member
![]() Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
|
Quote:
Quote:
Something like: if (ipaddr='127.0.0.1') do_not_check; else check; I have another idea: 6/Use launchpad for switch dropbear config and run ajaxterm. On second run of script kill ajaxterm and switch config back to allow WIFI mode. (Restarting dropbear to apply changed config is needed :-)) AjaxTerm seems to use ssh to localhost - it need login to access it. Last edited by centaurian; 11-07-2010 at 03:54 AM. |
||
![]() |
![]() |
![]() |
#8 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@centaurian: Huh.
Will patch dropbear to bypass auth when connecting from localhost in the next USBNetwork release. |
![]() |
![]() |
![]() |
#9 |
Member
![]() Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
|
That will by fine. Thank you. ;-)
|
![]() |
![]() |
![]() |
#10 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@centaurian: Done. Given the fact that I probably won't be able to release it properly for a few days, here's the updated dropbear binary. (Just overwrite the one in usbnet/bin with this one, and restart sshd [by switching usbnet off/on]).
It'll also be useful to check that my patch indeed works as intended, and that I didn't break anything ![]() Last edited by NiLuJe; 11-07-2010 at 11:24 AM. |
![]() |
![]() |
![]() |
#11 |
Member
![]() Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
|
I tested it. From WIFI it still needs key file, from localhost not (by "ssh localhost" - that good). But AjaxTerm still refuses me to connect with "Login Incorrect". So I am looking at AjaxTerm sources, how it really works...
Edit: I was wrong. It don't use ssh. ![]() Last edited by centaurian; 11-07-2010 at 09:49 AM. |
![]() |
![]() |
![]() |
#12 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 23
Karma: 22222
Join Date: Oct 2010
Device: kindle3
|
Ajaxterm does not use ssh, just calls login.
I have put up an updated version which lets you just drop into a shell by running the server side as myts --cmd sh (or whatever other command you want to run) http://info.iet.unipi.it/~luigi/kind...m-20101107.tgz I have not had time to test the kindle binary, it works on the host though so hopefully it should work there too. cheers luigi |
![]() |
![]() |
![]() |
#13 |
Member
![]() Posts: 12
Karma: 10
Join Date: Nov 2010
Location: Czech Republic
Device: Kindle 3 - 3G
|
Now it works :-).
I made run script for launchpad. On first run it runs AjaxTerm from /mnt/us/local/terminal/ directory. On second run it kills it. Run it with: Code:
/mnt/us/local/terminal/terminal.sh > /dev/null |
![]() |
![]() |
![]() |
#14 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 23
Karma: 22222
Join Date: Oct 2010
Device: kindle3
|
i believe it would be good to keep a web server always on (hopefully it doesn't consume too much power) from which we could enable/disable/modify the various features (usbnetwork, launchpad configurations etc.).
|
![]() |
![]() |
![]() |
#15 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@lrizzo/centaurian: Okay, good to know
![]() FYI, the login applet of the busybox binary shipped with usbnetwork will skip password auth and drop you in a full root login shell. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle, Calibre, Author sort | gdaydigger | Calibre | 5 | 03-11-2014 08:21 PM |
Kindle app for iPad appears in the App Store | pilotbob | News | 46 | 04-06-2010 08:25 PM |
kindle app? is it possible to design a app to full support PDF? | lili1989 | Amazon Kindle | 12 | 02-05-2010 05:29 PM |
Author Sort & Kindle | seagull | Calibre | 0 | 12-25-2009 12:42 PM |
How does kindle sort pictures? | princeofegypt | Amazon Kindle | 1 | 04-24-2009 04:54 PM |