11-17-2010, 05:15 AM | #1 |
Enthusiast
Posts: 45
Karma: 10842
Join Date: Aug 2010
Device: Kindle DXG
|
KindleTERM - a SSH client kindlet
Hi,
I wrote a quick and dirty hack based on the MidpSSH J2ME SSH/telnet client, to make it run on Kindle. Well, I am somewhat hesitant on the 'quick' part, since it took me a good amount of time during the last 3 weeks, but it is certainly dirty . You can find the git repo on GitHub. Thanks to Andrew de Quincey for making possible writing kindlets without the highly restricted Amazon development kit. I've only had the opportunity to test it on my Kindle DXG, so I don't know how well it performs on other models. I will describe the installation process in case someone is willing to try it. The usual disclaimer applies: You should not take the steps described below unless you are comfortable about messing with your device and potentially bricking it. DO IT ON YOUR OWN RISK - if something goes wrong I will probably not be able to help you. 1) Copy the developer.keystore in /var/local/java/keystore directory. I wanted to use the AdQ's keystore used for KIF but unfortunatelly Ant's signjar task fails with message: Code:
[signjar] jarsigner: Certificate chain not found for: dkadq. dkadq must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain. If someone have an idea how to fix it you are wellcome. 2) The Kindle framework's sandbox should be relaxed somewhat to allow SSH connections. In /opt/amazon/ebook/security/external.policy after "grant signedBy "Kindlet" {" add the lines Code:
permission java.net.SocketPermission "localhost:1024-", "accept, connect, listen"; permission java.net.SocketPermission "192.168.2.1", "connect, accept"; permission java.net.SocketPermission "localhost", "connect, accept"; 3) Copy the KindleTERM.azw2 to the 'documents' directory. Known bugs and limitations: - I am not sure if this is the case if you only make connections to the kindle (localhost), but I discovered that the connections from Kindle to other hosts are automatically disconnected after 2 or so minutes. If you want to prevent this you should stop netwatchd daemon. Code:
/etc/init.d/netwatchd stop - Key events handling is far from perfect. For example there is still no way to emulate "TAB" on the device's keyboard. It should be trivial to fix though. I implemented also a "remote keyboard" feature - the kindlet listens to port 3333 for key events. On the host machine you can start: Code:
java -cp KindleTERM.azw2 kindle.RemoteKeyboard It needs a java property file, named remote_keyboard.properties in the current working directory: Code:
host 192.168.2.2 port 3333 - If you choose to save session info it is saved in plain text in the kindlet's 'work' directory so it is a security risk also. Last edited by ixtab; 10-09-2013 at 05:02 AM. |
11-17-2010, 01:17 PM | #2 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Nice!
Here's a bunch of vt320 terminfo files (from the latest ncurses release), maybe one of them will help... . Last edited by HarryT; 10-08-2013 at 11:51 AM. |
Advert | |
|
11-17-2010, 04:35 PM | #3 |
Junior Member
Posts: 3
Karma: 10
Join Date: Oct 2010
Device: K3g
|
so just to confirm I understand this right - it runs as app on your kindle and allows you to connect via ssh either to the kindle itself or to a remote host - basically use kindle as ssh terminal / client?
|
11-18-2010, 04:41 AM | #4 |
Enthusiast
Posts: 45
Karma: 14412
Join Date: Oct 2010
Location: Spain
Device: Kindle 3 - 3G
|
Well done! I managed to install on my Kindle 3 (3G) and connect to localhost.
|
11-21-2010, 04:05 PM | #5 |
Junior Member
Posts: 5
Karma: 12
Join Date: Nov 2010
Location: Aberystwyth, UK
Device: Kindle 3 (3G)
|
You can find vt320 terminfo in the ncurses-term package on Debian and Ubuntu, however I found that most ncurses based applications (irssi, mutt, etc.) still don't behave correctly with it.
The simplest solution I've come up with is to set the TERM environment variable to "ansi" instead of "vt320". i.e. run "export TERM=ansi" after logging in. |
Advert | |
|
11-22-2010, 01:53 PM | #6 |
Junior Member
Posts: 2
Karma: 10
Join Date: Nov 2010
Device: Kindle 3 Wifi
|
Thank you
Last edited by stormont; 11-25-2010 at 06:53 PM. |
12-05-2010, 02:24 PM | #7 |
Junior Member
Posts: 4
Karma: 10
Join Date: Dec 2010
Device: Amazon Kindle
|
I try to connect to kindle with this params:
Code:
host: localhost port:22 username: root password: (what value do I need enter to this field?) Code:
Connecting to localhost:22 ...OK ... ... ... Requesting authentication Sent password Sent password Sent password Sent password Sent password Sent password Sent password Sent password Sent password Sent password |
12-05-2010, 05:16 PM | #8 | |
Junior Member
Posts: 2
Karma: 10
Join Date: Nov 2010
Device: Kindle 3 Wifi
|
Quote:
|
|
12-06-2010, 01:19 AM | #9 |
Junior Member
Posts: 4
Karma: 10
Join Date: Dec 2010
Device: Amazon Kindle
|
|
12-12-2010, 04:09 AM | #10 |
Junior Member
Posts: 1
Karma: 10
Join Date: Dec 2010
Device: Kindle 3 Wifi
|
Is there mapping for Ctrl key?
Thanks |
12-12-2010, 06:47 PM | #11 |
Hobbit
Posts: 20
Karma: 10
Join Date: Jan 2007
Location: Shizuoka, Japan
Device: k2i
|
Noob Question...
OK. I'm not computer-illiterate, but I am Kindle-hacking illiterate.
How do I get to the point where I can see /var/local/java/keystore on my Kindle 2? Currently I have the latest "jailbreak" and "screensaver hack" and "font hack" as described by NiLuJe in the Fonts & ScreenSavers hacks for Kindles thread. And I'm running the latest Kindle 2 firmware, 2.5.4. Not sure how to get root from this point. Sorry if this has been answered somewhere, but I can't seem to locate the answer myself. Thank you, and cheers. Jeffrey |
12-12-2010, 10:38 PM | #12 |
Hobbit
Posts: 20
Karma: 10
Join Date: Jan 2007
Location: Shizuoka, Japan
Device: k2i
|
(Deleted older comment)
OK. I got it all figured out. I read your blog and found the info I needed. I ended up using scp to get your developer key on there... (and later saw you made a .bin file that will do the same. Got your ktest, term, and kif (tested the first two so far). Great stuff! Thanks for all the hard work! Now, if I could figure out how to port Abiword or at least Pico (sorry, I'm not used to vi -- my bad). Cheers, Jeffrey Last edited by JDShaffer; 12-13-2010 at 08:11 AM. |
12-13-2010, 08:16 AM | #13 |
Hobbit
Posts: 20
Karma: 10
Join Date: Jan 2007
Location: Shizuoka, Japan
Device: k2i
|
-----
Last edited by JDShaffer; 12-13-2010 at 09:38 AM. Reason: Removed dumb question |
12-13-2010, 08:19 AM | #14 |
Hobbit
Posts: 20
Karma: 10
Join Date: Jan 2007
Location: Shizuoka, Japan
Device: k2i
|
Nevermind. Got it. Had to have usbNetworking running, even if I'm not using the laptop to connect in...
|
12-13-2010, 09:37 AM | #15 |
Hobbit
Posts: 20
Karma: 10
Join Date: Jan 2007
Location: Shizuoka, Japan
Device: k2i
|
@vdp -- VI looks nice full screen, but is there an ESC key built in to the KindleTERM app?
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using Kindle 3G as an ssh client - possible? how? | chrisisbd | Kindle Developer's Corner | 6 | 01-02-2012 05:33 AM |
Hacks Is there an ssh client for the Kindle ? | ninsei | Amazon Kindle | 3 | 11-18-2011 08:55 PM |
Android SSH Terminal (client) | kenjennings | enTourage Archive | 1 | 03-04-2011 10:30 PM |
iLiad SSH client for terminal access | IvarC | iRex Developer's Corner | 2 | 02-06-2009 01:21 PM |
iLiad how to use the iLiad as an ssh client? | nagyv | iRex Developer's Corner | 1 | 05-30-2008 12:54 AM |