2

I have a T-Mobile G1 and rooted it using AndRoot. I've confirmed that I have root by using Wireless Tethering, I get all the required request superuser permission dialogues.

However when I go to the Telnet application and try to telnet it refuses to let me, I get:

Error While connecting to server localhost/127.0.0.1:23 - Connection Refused.

I've tried various different connection strings (e.g. just 127.0.0.1, 0.0.0.0)

I read that you might need to reboot the phone after rooting so I did and then confirmed again that I still have su by using wireless tether and superuser permissions app.

Is there anyway I can get this working as I'd like to flash Amon Ra's Recovery mod and start playing around with the Roms again.

3 Answers 3

1

AFAIK, mostly port 1-1024 on android phone are reserved for system, so the application other than system must use port > 1024.

I never use telnet, but I used ssh frequently to remote my phone, I use SSH server on phone using http://teslacoilsw.com/quicksshd maybe you can use ssh as an alternative to telnet.

3
  • I am using ConnectBot but it is quite the same functionnality code.google.com/p/connectbot
    – Natim
    Commented Sep 22, 2010 at 12:57
  • 1
    In the end I used connectbot and set to local then localhost and it connected fine, I su'd up and logged me in as root.
    – digital
    Commented Sep 23, 2010 at 0:27
  • Another option is to telnet over USB debugging, using adb forward
    – Broam
    Commented Feb 3, 2012 at 13:50
0

First off, read this thread on XDA Forums to make sure you are properly rooted. If you are positive you are properly and fully rooted then what app are you using? I have never heard of the app Telnet. Try SwiFTP. It is easily configurable and has always worked on my rooted devices.

3
  • I mentioned the app in the op, AndRoot. I've read that guide the first time I rooted my phone and while it is a good guide I thought I'd try it a different way.
    – digital
    Commented Sep 21, 2010 at 19:50
  • No what app are using to attempt to telnet into the phone?
    – Webs
    Commented Sep 21, 2010 at 21:07
  • Telnet isn't an app, it's a protocol. The OP needs Terminal Emulator or ConnectBot - or to telnet from their desktop.
    – Broam
    Commented Feb 3, 2012 at 13:50
0

Digital,

You need to be more clear about your intentions. What are you trying to telnet to/from? If you want to telnet to your phone, it's not as easy as running telnet on your computer by entering your phone's IP address. You have to run a telnet server on the phone -- otherwise the connection is refused. The best way to tell if you are actually rooted is by using Terminal Emulator. When you run Term you will see a "$", this is a user prompt, where you type in commands. The "$" means you are a normal user, not root. HOWEVER, if you type "su" and hit enter and you end up with a "#" prompt, that means you are superuser (root). If you can successfully get a superuser prompt, you are properly rooted. (You might get a superuser permissions request for Term when you first run "su").

Once you are on a superuser prompt you can run a telnet/SSH server (telnet is not recommended, as it is insecure).

To see if you have an SSH server installed on your phone (you should already if you run a mod, otherwise you will probably have to install one manually), type the following command (as root) in Term:

find / -name dropbear

It should return "/system/xbin/dropbear", unless your mod has a slightly different filesys structure, in which case it might return a slightly different string, or error out altogether.

If you do have dropbear, you can continue reading (otherwise install dropbear first, then continue from here).

Now, as root in Term (make sure you have the "#" prompt, or type "whoami" to see what your username is), enter the following commands one at a time (stop if any give an error). Be VERY cautious when entering commands as root! Make SURE you type everything exact including proper case.

mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
mkdir /system/etc/dropbear
cd /system/etc/dropbear
dropbearkey -t rsa -f /system/etc/dropbear/dropbear_rsa_host_key
dropbearkey -t dss -f /system/etc/dropbear/dropbear_dss_host_key

IF THE ABOVE COMMANDS WERE SUCCESSFUL enter the following commands to complete the process:

sync
mount -o remount,ro -t yaffs2 /dev/block/mtdblock4 /system

You now have SSH server capability on your Android device. Note that this does not mean you are running and SSH server at this point, only that you are capable.

To run your SSH server, first enter the following (again, as root) in Term:

dropbear -p WANIP

(Replace "WANIP" with the external IP of your phone -- the IP you want to SSH in to)

Your SSH server should now be running. You can check this by typing:

ps|grep dropbear

It should return a line that ends with the word "dropbear"

NOTE Depending on your version of Android or mod, some of these steps may vary. If you encounter a problem (dropbear doesn't run, or you can't SSH in), first check if dropbear is still running (above command) and then run "dropbear -E" to see why it won't start if it is not running.

I'm more than willing to answer any further questions you may have. Happy hacking!

2
  • Hi thanks for the great reply. I've confirmed I have SU now. When I first rooted my phone over a year ago I could use the app Telnet fine, I guess things must have changed since.
    – digital
    Commented Sep 23, 2010 at 11:26
  • That's correct, in earlier Android releases, telnet was more accessible. They (the Android developers) were quick to lock it down a bit better once custom ROMs started making the rounds.
    – ch3mi0n
    Commented Sep 24, 2010 at 3:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .