Monday, April 18, 2016

How to start SSH Server in my Android?


I am trying to login to Android Eee pad transformer from my other linux box using SSH. This are the step i followed and failed. So asking here for the correct answer.


1) Go to Android market and download install Connectbot




  • Launching ConnectBot

  • Asks ssh or telnet or local

  • Press local

  • Asks username

  • Username applied dummy

  • Connected to local Android

  • type ip addr; in the terminal shows ip address and i can ping 8.8.8.8


enter image description here



2) Now i want to access to this box from outside box



  • Go to Android market and install SSDroid and SuperUser

  • Launch SSDroid

  • SSDroid says root:off, sftp://root@ipOfthisAndroidBox:2222 ready

  • From another box i try to login using ssh root@ipOfthisAndroidBox:2222 fails


enter image description here


3) Launch SuperUser it tries to install something but fails


enter image description here



All i get to verify am i rooted, always it shows:


$ su
su: permission denied

Follow up: How do i login after installing SSHDroid?


[sun@example ~]$ ssh root@94.xx.xx.xx -p 2222
The authenticity of host '[94.xx.xx.xx]:2222 ([94.xx.xx.xx]:2222)' can't be established.
RSA key fingerprint is 14:ae:33:xxxx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[94.xx.xx.xx]:2222' (RSA) to the list of known hosts.

SSHDroid
Use 'root' on rooted devices otherwise any username works
Default password is 'admin'
root@94.xx.xx.xx's password:
/data/data/berserker.android.apps.sshdroid/home $ uname -a
Linux localhost 2.6.36.3-00004-g069b8b5 #1 SMP PREEMPT Wed May 11 22:14:22 CST 2011 armv7l GNU/Linux
/data/data/berserker.android.apps.sshdroid/home $ uptime
09:20:16 up 2 min, load average: 0.26, 0.25, 0.11

/ $ ls

EeePad_bootup_first_page.rle acct default.prop init.ventana.rc sys
OSD_battery_100.rle bin dev mnt system
OSD_battery_25.rle cache etc proc ueventd.goldfish.rc
OSD_battery_50.rle config init root ueventd.rc
OSD_battery_75.rle d init.goldfish.rc sbin ueventd.ventana.rc
Removable data init.rc sdcard vendor

More informations: https://gist.github.com/1357588

How do i login to my Android box from other distro's? (I am using Fedora, CentOS, FreeBSD).




Answer



SSHDroid does not need root, it's optional. Every App can bind a socket on an not privileged port (>1024).


I am pretty sure that your ssh client parameters are wrong, the port especially. AFAIK you can't add the port via : to the hostname. Try ssh root@ipofandroid -p 2222 instead.


If you need more verbose output of the ssh binary, start it with -v, -vv or -vvv. This helps to figure out problems.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...