Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I am having difficulty ssh'ing into my new Android 4 (Samsung Nexus) phone.

I have installed various SSH Servers but in in all cases the ssh connection just hangs (i.e. I don't get as far as username/password).

As an example, using SSHDroid:

Verbose SSH log from my linux box :

joel@pepper ~ $ ssh  -p 2222 root@192.168.1.65 -vvv
OpenSSH_5.8p1 Debian-1ubuntu3, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.1.65 [192.168.1.65] port 2222.

The output from nmap does not look right. A status of filtered on the port implies a firewall is blocking it:

joel@pepper ~ $ sudo nmap -sS  192.168.1.65 

Starting Nmap 5.21 ( http://nmap.org ) at 2011-11-20 21:29 GMT
Nmap scan report for android-63731d6ebec9e01.lan (192.168.1.65)
Host is up (0.019s latency).
Not shown: 999 closed ports
PORT     STATE    SERVICE
2222/tcp filtered unknown
MAC Address: A0:0B:BA:B4:5F:59 (Unknown)
share|improve this question
3  
This really locks like blocked ports. You could also try a ping, followed by an telnet <ip> <ssh_port> and you could confirm that the socket is opened on OS level via netstat -ltnp. –  Flow Nov 21 '11 at 13:42

2 Answers 2

As far as I know, the default ssh port IS 22 on Ubuntu, just as "Lie Ryan" pointed out. You might want to check your sshd_config files on your PC, if you want to take a look at this article, it specifies on how to change the default ssh configuration on Ubuntu--as well as the official documentation. Beyond that, check your current firewall settings, you might be able to open that specific port temporarily to ssh-type service if you want to confirm that it's not something else.

Aside from that, it seems to me that this question was asked more than 6 months ago; if the OP hasn't figured it out by now, I doubt he'll be interested to pursue it further. I suggest either accept an answer, provide update on the situation since, or perhaps close the question.

EDIT: depending on your android ssh-server app, and whether or not you're running it with su privileges, this is from the "QuickSSHD" website:

non-root users are limited to ports < 1024 and the QuickSSHd application user, which CAN read and write to the SD Card.

share|improve this answer
1  
Don't you mean > 1024? –  Ehtesh Choudhury Apr 28 '13 at 12:36
    
that is the exact thing that's on the website...copied and pasted. Here you go, take a look for yourself –  ILMostro_7 Apr 28 '13 at 12:56
    
That's probably a typo. Generally ports < 1024 are reserved to root user, and other ports can be accessed by anyone. unix.stackexchange.com/questions/16564/… –  Ehtesh Choudhury Apr 28 '13 at 12:59
    
I don't know...but, as I said, generally there's a reason why most android-based SSH-servers require root permission; and if the OP is having trouble accessing it from PC, it may explain it, since SSHDroid and QuickSSHD are very similar and based on the same "core parts" –  ILMostro_7 Apr 28 '13 at 13:06
    
Oh sure, I'm just talking about communicating on ports in question. I know that SSHD on android runs on 2222, usually. –  Ehtesh Choudhury Apr 28 '13 at 13:30

The default ssh port is 22 not 2222, perhaps that's the root cause of the issue? Try connecting on port 22.

share|improve this answer
    
Actually, all the SSH servers on the market that I know of use the port 2222. –  Liam W Dec 20 '12 at 14:25
1  
Ports below 1024 are only available to root users on Linux, that's why SSH servers on Android don't use port 22 as the default. –  elmicha Dec 31 '12 at 15:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.