1. Download our Official Android App: Forums for Android!

Root Putty to Galaxo over USB!

Discussion in 'Android Devices' started by kam187, Oct 16, 2009.

  1. kam187

    kam187 Android Expert
    Thread Starter
    Rank:
    None
    Points:
    118
    Posts:
    1,320
    Joined:
    Aug 3, 2009

    Aug 3, 2009
    1,320
    46
    118
    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!
     

    Advertisement

  2. zenderady

    zenderady Newbie
    Rank:
    None
    Points:
    15
    Posts:
    15
    Joined:
    Mar 25, 2009

    Mar 25, 2009
    15
    0
    15
    I have no clue when it comes to linux but I love my phone so I'd like to know everything about it.. can you please tell me what all those things that you wrote could help me to?
     
  3. kam187

    kam187 Android Expert
    Thread Starter
    Rank:
    None
    Points:
    118
    Posts:
    1,320
    Joined:
    Aug 3, 2009

    Aug 3, 2009
    1,320
    46
    118
    UK
    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 :)
     
  4. Rastaman-FB

    Rastaman-FB Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    6,113
    Joined:
    Sep 11, 2009

    Sep 11, 2009
    6,113
    1,010
    313
    UK
    ahh so thats what that mess is in cmd when using adb shell on galaxo rom
    makes sense now.

    will take a look later
     
  5. drakaz

    drakaz Newbie
    Rank:
    None
    Points:
    18
    Posts:
    23
    Joined:
    Oct 17, 2009

    Oct 17, 2009
    23
    21
    18
    You can also just type "sh", after adb shell, to use simply shell without color prompt ;)
     
  6. kam187

    kam187 Android Expert
    Thread Starter
    Rank:
    None
    Points:
    118
    Posts:
    1,320
    Joined:
    Aug 3, 2009

    Aug 3, 2009
    1,320
    46
    118
    UK
    Yeah, i tried that first, but if you type ls, or try vim its a mess. Anyway I prefer using putty over cmd. I can copy and paste easily, set a huge buffer and stretch the screen width past 80 chars :)
     
  7. Rastaman-FB

    Rastaman-FB Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    6,113
    Joined:
    Sep 11, 2009

    Sep 11, 2009
    6,113
    1,010
    313
    UK
    Code (Text):
    1. c:\android-sdk-windows-1.5_r3\tools>adb forward tcp:9999 tcp:2222
    2.  
    3. c:\android-sdk-windows-1.5_r3\tools>adb shell "/system/xbin/dropbear -E -A -N ro
    4. ot -U 0 -G 0 -C password -p 2222"
    5. [3047] Oct 17 08:17:11 Failed reading '/etc/dropbear/dropbear_rsa_host_key', dis
    6. abling RSA
    7. [3047] Oct 17 08:17:11 Failed reading '/etc/dropbear/dropbear_dss_host_key', dis
    8. abling DSS
    9. [3047] Oct 17 08:17:11 premature exit: No hostkeys available/CODE]
    10. where am i going wrong?
    11.  
    12.  
    13. EDIT sorry im ******** :P
    14.  
    15. worked it out
    16. too early for me had a hard week and im sorting both my kids out this morning
     
  8. drakaz

    drakaz Newbie
    Rank:
    None
    Points:
    18
    Posts:
    23
    Joined:
    Oct 17, 2009

    Oct 17, 2009
    23
    21
    18

    You right, in the case of ls, you can add an alias with "ls --colors=never"...but like you i think using putty is better :D
     
  9. drakaz

    drakaz Newbie
    Rank:
    None
    Points:
    18
    Posts:
    23
    Joined:
    Oct 17, 2009

    Oct 17, 2009
    23
    21
    18
     
  10. tiran

    tiran Lurker
    Rank:
    None
    Points:
    5
    Posts:
    4
    Joined:
    Oct 17, 2009

    Oct 17, 2009
    4
    0
    5
    Hey thank ist much more comfortable...

    But two things, my courser keys dont work for cmdln history and second the tab key does not work for cmdln completion.

    Any one an idea. How to fix it?

    By the way it doesnt work with ssh over wifi ether.
    Thanks
     
  11. kam187

    kam187 Android Expert
    Thread Starter
    Rank:
    None
    Points:
    118
    Posts:
    1,320
    Joined:
    Aug 3, 2009

    Aug 3, 2009
    1,320
    46
    118
    UK
    Yeah i was going to look at that (command completion and history) but it got late :p

    Maybe later. Wierd it should work over Wifi, but you should be using port 2222 in that case and sshing directly to the phone.
     
  12. pegasus21

    pegasus21 Android Enthusiast
    Rank:
    None
    Points:
    36
    Posts:
    253
    Joined:
    Aug 26, 2009

    Aug 26, 2009
    253
    1
    36
    For name completion and command history, ash works.
    After you login, just type ash and you get those features.

    bash also works and seems to be the shell that's also used with adb shell
     
  13. testman

    testman Lurker
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Oct 19, 2009

    Oct 19, 2009
    2
    0
    5
    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
     

    Attached Files:

  14. kam187

    kam187 Android Expert
    Thread Starter
    Rank:
    None
    Points:
    118
    Posts:
    1,320
    Joined:
    Aug 3, 2009

    Aug 3, 2009
    1,320
    46
    118
    UK
    I messed around with all of this too! In the end I just gave up and used ssh. I'll have another look when I have some time, but with the bat files, the ssh method is pretty easy too.
     
  15. Nefser

    Nefser Member
    Rank:
    None
    Points:
    16
    Posts:
    31
    Joined:
    Oct 14, 2009

    Oct 14, 2009
    31
    3
    16
    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.
     
  16. testman

    testman Lurker
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Oct 19, 2009

    Oct 19, 2009
    2
    0
    5
    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 ?
     
  17. ectomorph

    ectomorph Newbie
    Rank:
    None
    Points:
    15
    Posts:
    13
    Joined:
    Mar 25, 2010

    Mar 25, 2010
    13
    0
    15
    Software Developer
    St Andrews, Vic, Australia
    I'm trying to putty/ssh into my phone, username is root but whats the password ? I just enabled SSH in galaxo config so i assume there must be a default pw or something?
     
  18. ectomorph

    ectomorph Newbie
    Rank:
    None
    Points:
    15
    Posts:
    13
    Joined:
    Mar 25, 2010

    Mar 25, 2010
    13
    0
    15
    Software Developer
    St Andrews, Vic, Australia
    Sorry, being thick (should read instructions more carefully :) ). Sorted!
     

Share This Page

Loading...