• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Putty to Galaxo over USB!

kam187

Android Expert
Aug 3, 2009
1,320
46
UK
So I noticed galaxo is using a colour term profile which is really nice, except for us poor windows users :(

You could of course enable SSH, reboot, and turn wifi on and then ssh in using putty, but that's not really that convenient. Especially if you dont like to leave ssh running.

Instead you can run dropbear manually and redirect the port using adb, then putty in directly.

Anyway I just made 2 .bat files:

_SSH_ON.bat
adb forward tcp:9999 tcp:2222
adb shell "/system/xbin/dropbear -E -A -N root -U 0 -G 0 -C password -p 2222"

_SSH_OFF.bat
adb shell "kill `ps | grep dropbear | awk '{print $1}'`"

You can change 'password' to anything you like. The SSH_OFF just finds the dropbear pid and kills it.

After running SSH_ON just putty to 127.0.0.1 and port 9999, make sure to select ssh as the protocol. And hey presto a nice colour shell, and stuff like vim also works!
 
you can use adb (part of the android sdk) to open a shell (like a command prompt) to your phone. The above just lets you do it through putty, which gives you a nice colour version of that window, instead of loads of wierd characters.

If you don't know what adb is, don't worry. This post isnt really for you :)
 
Upvote 0
Code:
c:\android-sdk-windows-1.5_r3\tools>adb forward tcp:9999 tcp:2222

c:\android-sdk-windows-1.5_r3\tools>adb shell "/system/xbin/dropbear -E -A -N ro
ot -U 0 -G 0 -C password -p 2222"
[3047] Oct 17 08:17:11 Failed reading '/etc/dropbear/dropbear_rsa_host_key', dis
abling RSA
[3047] Oct 17 08:17:11 Failed reading '/etc/dropbear/dropbear_dss_host_key', dis
abling DSS
[3047] Oct 17 08:17:11 premature exit: No hostkeys available/CODE]
where am i going wrong?


EDIT sorry im ******** :P

worked it out
too early for me had a hard week and im sorting both my kids out this morning
 
Upvote 0
Code:
c:\android-sdk-windows-1.5_r3\tools>adb forward tcp:9999 tcp:2222

c:\android-sdk-windows-1.5_r3\tools>adb shell "/system/xbin/dropbear -E -A -N ro
ot -U 0 -G 0 -C password -p 2222"
[3047] Oct 17 08:17:11 Failed reading '/etc/dropbear/dropbear_rsa_host_key', dis
abling RSA
[3047] Oct 17 08:17:11 Failed reading '/etc/dropbear/dropbear_dss_host_key', dis
abling DSS
[3047] Oct 17 08:17:11 premature exit: No hostkeys available/CODE]
where am i going wrong?


EDIT sorry im ******** :P

worked it out
too early for me had a hard week and im sorting both my kids out this morning[/quote]


You must turn at least once ssh using GalaxoConf (and reboot to apply) to enable rc to create the keys. (after that you can disable it in GalaxoConf, reboot again, and use kam197 method).
 
Upvote 0
Hello Drakaz, Kam187,

Here is some work around the coloring on WinNT+ (XP, etc).

Add the line:
DEVICE=%SystemRoot%\system32\ANSI.SYS
in file :
C:\WINDOWS\system32\CONFIG.NT

Then lanch a command.com (and not a "cmd")

Try color mode using :
PROMPT $E[0;32;40m$P$G$E[0;32;40m

This shows the the ANSI X3.64 syntax/escaping work.

Now, the problem is that if you launch an "adb shell" you still do not get get ASCII sequence work :(

You get sequences like :
"←[01;32m[root@galaxy←[01;31m:←[01;34m/]←[00m"

My current understanding is that the ESC char might be the wrong one (some unicode char is displayed instead of the ESC used, why ?!?).

If you dont like the limitations of command.com you can also use TCC LE (previous version was called 4NT) and use the command SETDOS /A1 that enables the ANSI translation under TCC. You will used then the same commands and fail at the same place : this really make me thing there is an problem with the ESC value send thru ADB :(

Any idea what is going wrong around the ESC ?

Rgs,
TM
 

Attachments

  • command-color.jpg
    command-color.jpg
    19 KB · Views: 184
Upvote 0
Kam187++ As with many other posts, thanks for the suggestions using the shell with putty. Simple and works great.


Pegasus21++ Thanks for the comments re: ash/bash. I don't use *nix very often, so little reminders are quite helpful.


It may not be necessary to have this ability, but when you do, its nice that it's this easy.
 
Upvote 0
Can anybody with a factory version of a phone (not a drakaz build) test the following command :

printf "esc\x1bape\n"

With drakaz distro, the result I get in the shell is :

esc←ape

Which means that instead of \u001B you get \u2190 :eek:

There must be something in the write process that is wrong with win32.

Anybody with a cygwin version of adb under win32 to check it it is doing the same mistake ?

Is the android bash UTF_8 ? UTF_16 ?
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones