Putty to Galaxo over USB!


Last Updated:

  1. kam187

    kam187 Well-Known Member This Topic's Starter

    Joined:
    Aug 3, 2009
    Messages:
    1,320
    Likes Received:
    46
    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 Member

    Joined:
    Mar 25, 2009
    Messages:
    15
    Likes Received:
    0
    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 Well-Known Member This Topic's Starter

    Joined:
    Aug 3, 2009
    Messages:
    1,320
    Likes Received:
    46
    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 Well-Known Member

    Joined:
    Sep 11, 2009
    Messages:
    6,113
    Likes Received:
    1,010
    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 Member

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

    kam187 Well-Known Member This Topic's Starter

    Joined:
    Aug 3, 2009
    Messages:
    1,320
    Likes Received:
    46
    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 Well-Known Member

    Joined:
    Sep 11, 2009
    Messages:
    6,113
    Likes Received:
    1,010
    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 Member

    Joined:
    Oct 17, 2009
    Messages:
    23
    Likes Received:
    21

    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 Member

    Joined:
    Oct 17, 2009
    Messages:
    23
    Likes Received:
    21
     
  10. tiran

    tiran New Member

    Joined:
    Oct 17, 2009
    Messages:
    4
    Likes Received:
    0
    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 Well-Known Member This Topic's Starter

    Joined:
    Aug 3, 2009
    Messages:
    1,320
    Likes Received:
    46
    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 Well-Known Member

    Joined:
    Aug 26, 2009
    Messages:
    253
    Likes Received:
    1
    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 New Member

    Joined:
    Oct 19, 2009
    Messages:
    2
    Likes Received:
    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
     

    Attached Files:

  14. kam187

    kam187 Well-Known Member This Topic's Starter

    Joined:
    Aug 3, 2009
    Messages:
    1,320
    Likes Received:
    46
    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 Active Member

    Joined:
    Oct 14, 2009
    Messages:
    31
    Likes Received:
    3
    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 New Member

    Joined:
    Oct 19, 2009
    Messages:
    2
    Likes Received:
    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 ?
     
  17. ectomorph

    ectomorph Member

    Joined:
    Mar 25, 2010
    Messages:
    13
    Likes Received:
    0
    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 Member

    Joined:
    Mar 25, 2010
    Messages:
    13
    Likes Received:
    0
    Sorry, being thick (should read instructions more carefully :) ). Sorted!
     

Share This Page

Loading...