7

I can't seem to ssh into my Android device. I have not rooted the device and I don't really want to. I tried connecting to it via the terminal using the following command:

ssh root@ip-address:port-number

the error I received was:

name or service is not known

How can I resolve it?

5
  • First, if you have not rooted your device, you obviously cannot login as root. Second, have you configured and started the SSH service on your Android device? Have you verified the IP address and port number are matching?
    – Izzy
    Aug 9, 2015 at 12:13
  • @Izzy I have thought of that. Then how can I check for my username in my android device? I use sshdroid and it starts a ssh server for me. I am not sure how to verify that.
    – user121392
    Aug 9, 2015 at 12:21
  • run id, your regular user id would be something like uid=10061 [u0_a61]
    – moonbutt74
    Aug 9, 2015 at 13:06
  • 1
    This answer states to use ssh <user>@<ip> -p <port> instead of the "colon syntax". Then, you can define a port (default: 2222) and password in SSHDroid's "options". To connect, according to the screenshots on the app's playstore page, you can use any username with that password. Thus, e.g. ssh me@<android-ip> -p 2222 should do the job.
    – Izzy
    Aug 9, 2015 at 13:39
  • 1
    PS: No need to add "solved" to the title (which is done on a forum usually). On SE sites, the "check-mark" is used instead – thanks for ticking that :)
    – Izzy
    Aug 9, 2015 at 18:44

1 Answer 1

6

Summing up from the comments

  1. This answer states to use ssh <user>@<ip> -p <port> instead of the "colon syntax"
  2. In SSHDroid, go to "Options" and check/define the port (default: 2222) and password to be used
  3. According to the screenshots on the app's playstore page, if not using root mode you can use any user name to connect. Thus if you followed above steps, this should now work (of course with <android-ip> replaced by the real IP address of the Android device):

    ssh me@<android-ip> -p 2222
    

You must log in to answer this question.

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