View Single Post
Old 06-30-2012, 09:03 PM   #1
rkomar
Wizard
rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.rkomar ought to be getting tired of karma fortunes by now.
 
Posts: 2,986
Karma: 18343081
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
utelnetd - yet another remote shell application

It bothers me that I can't get a nice shell using ssh anymore under the newest firmware versions. So I looked around, and found that @reader42 already ported the utelnetd telnet server to PocketBook devices. Very nice! Using his source code, I packaged up versions for the older 3XX and the newer Pro/360+ devices. I've also included a copy of bash in each package. Pick the right zip file for your device, and unzip the contents in /mnt/ext1/.

Instead of using the Inkview application that @reader42 provided for controlling the daemon, I used a couple of shell scripts instead (utelnetd_start.app and utelnetd_stop.app). I did this because they are smaller, platform-independent, and, most importantly, run in the background. Thus, you can do other stuff on the device while logged in via telnet (which makes it nice for debugging).

Within the Applications tab, click on utelnetd_start to start the server in the background and connect to the net, and click on utelnetd_stop to disconnect from the net and kill the server. While the server is running, you can telnet to the device via port 10000:

Code:
telnet <IP-address> 10000
You get a prompt, command history and editting, and even vi behaves nicely.

You can change the port number by editting the applications/utelnetd_start.app script. If you want to put bash somewhere else than /mnt/ext1/system/bin, then you need to rebuild utelnetd for that. Get the sources from: http://sourceforge.net/apps/mediawik...for_PocketBook. I've also uploaded the updated Makefile I used to build utelnetd. You need to change the Makefile if you want to put bash somewhere other than /mnt/ext1/system/bin/.

Thanks @reader42

Edit: I should point out that when you exit the telnet session on the PC, the terminal seems to hang until the server is killed on the device. I don't know how to fix that, so please pipe up anyone that does.

Edit1: Added /mnt/ext1/system/bin automatically to the PATH for the shell.

Edit2: Added pop up dialog that states what IP address and port it is listening to. You have to install sh_ivtool.app (found in the Developer section) and uncomment the line in applications/utelnetd_start.app that starts with "#SH_IVTOOLS=" to see the dialog.
Attached Files
File Type: zip Makefile.zip (849 Bytes, 451 views)
File Type: zip utelnetd-Pro.zip (585.7 KB, 280 views)
File Type: zip utelnetd-3XX.zip (537.1 KB, 252 views)

Last edited by rkomar; 02-11-2018 at 03:39 PM.
rkomar is offline   Reply With Quote