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