Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to log into my android phone (running sshdroid), using my laptop (ubuntu 12.04). I am on a university sub-network (on wifi), and so is my phone. I tried the following command:

ssh root@my_phone_ip -p 2222

But the laptop fires back a

ssh: connect to host 172.20.27.169 port 2222: No route to host

I cannot even ping to my phone, it gives a destination host unreachable error. I looked for the route information on my laptop which is

root@abadmin-Vostro-3500:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

default         eduspot-berlioz 0.0.0.0         UG    0      0        0 wlan0

link-local      *               255.255.0.0     U     1000   0        0 wlan0

172.16.185.0    *               255.255.255.0   U     0      0        0 vmnet1

172.20.0.0      *               255.255.0.0     U     2      0        0 wlan0

192.168.248.0   *               255.255.255.0   U     0      0        0 vmnet8

To check what packets were going through I have tried a tcpdump -i wlan0, but I could not find any interesting packets. I'm inserting the dump here for further info.

root@abadmin-Vostro-3500:~# tcpdump -i wlan0 
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlan0, link-type EN10MB (Ethernet), capture size 65535 bytes
19:45:12.354445 IP6 fe80::1416:f700:ff98:a65 > ff02::1:ff3a:6694: ICMP6, neighbor solicitation, who has fe80::51e2:6e29:ff3a:6694, length 32
19:45:12.355303 IP abadmin-Vostro-3500.local.54924 > eduspot-berlioz.crous- grenoble.fr.domain: 44239+ PTR?       4.9.6.6.a.3.f.f.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.f.f.ip6.arpa. (90)
19:45:12.364296 IP eduspot-berlioz.crous-grenoble.fr.domain > abadmin-Vostro-3500.local.54924: 44239 NXDomain 0/0/0 (90)
19:45:12.364742 IP abadmin-Vostro-3500.local.53789 > eduspot-berlioz.crous-grenoble.fr.domain: 29641+ PTR? 5.6.a.0.8.9.f.f.0.0.7.f.6.1.4.1.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (90)
19:45:12.368422 IP eduspot-berlioz.crous-grenoble.fr.domain > abadmin-Vostro-3500.local.53789: 29641 NXDomain 0/0/0 (90)
19:45:12.368740 IP abadmin-Vostro-3500.local.2590 > eduspot-berlioz.crous-grenoble.fr.domain: 39336+ PTR? 4.9.6.6.a.3.f.f.9.2.e.6.2.e.1.5.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (90)
19:45:12.373988 IP eduspot-berlioz.crous-grenoble.fr.domain > abadmin-Vostro-3500.local.2590: 39336 NXDomain 0/0/0 (90)
19:45:12.374372 IP abadmin-Vostro-3500.local.5879 > eduspot-berlioz.crous-grenoble.fr.domain: 3348+ PTR? 254.255.20.172.in-addr.arpa. (45)
19:45:12.389099 IP eduspot-berlioz.crous-grenoble.fr.domain > abadmin-Vostro-3500.local.5879: 3348* 1/0/0 PTR eduspot-berlioz.crous-grenoble.fr. (92)
19:45:12.389455 IP abadmin-Vostro-3500.local.30761 > eduspot-berlioz.crous-grenoble.fr.domain: 14063+ PTR? 186.27.20.172.in-addr.arpa. (44)
19:45:12.393315 IP eduspot-berlioz.crous-grenoble.fr.domain > abadmin-Vostro-3500.local.30761: 14063 NXDomain 0/0/0 (44)
^C  19:45:12.411446 IP 172.20.18.214.netbios-ns > 172.20.255.255.netbios-ns: NBT UDP   PACKET(137): QUERY; REQUEST; BROADCAST

12 packets captured
525 packets received by filter
483 packets dropped by kernel

iptables output:

Chain INPUT (policy ACCEPT) target prot opt source destination 
ACCEPT 47 -- 0.0.0.0/0 0.0.0.0/0 
Chain FORWARD (policy ACCEPT) target prot opt source destination 
Chain OUTPUT (policy ACCEPT) target prot opt source destination' 

Please help me log into my phone.. its been frustrating me for 2 days now. Thanks ahead of time

share|improve this question
    
Make sure firewall is not blocking your access try iptables -L -n –  Networker Jun 14 at 17:58
    
@Networker, I got the following output, can't infer from it though Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT 47 -- 0.0.0.0/0 0.0.0.0/0 Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination' –  Abhay Jun 14 at 18:02
    
please add the comment to your question using edit –  Networker Jun 14 at 18:03
    
yes, i do have an ip address asssigned to the interface wlan0, and yes i can ping to my default gateway –  Abhay Jun 14 at 18:09

1 Answer 1

edit your firewall to accept the port 2222:

iptables -A INPUT -p tcp --dport 2222 -j ACCEPT

if it doesn't solve the problem, selinux might be the problem so try this:

make it allow port 2222:

semanage port -a -t ssh_port_t -p tcp 2222

also see if the port is open using nmap:

nmap -p 2222 172.20.27.169

and if you have changed any configuration file ( defining the port 2222) you have to restart sshd:

service sshd restart
share|improve this answer
    
tried it, does not work, Also if it helps I tried ufw status I received Status: inactive So net filtering is off AFAIK –  Abhay Jun 14 at 18:16
    
The host seems down, i am wondering why so..? root@abadmin-Vostro-3500:~# nmap -p 2222 172.20.27.169 Starting Nmap 5.21 ( http://nmap.org ) at 2014-06-14 20:43 CEST Note: Host seems down. If it is really up, but blocking our ping probes, try -PN Nmap done: 1 IP address (0 hosts up) scanned in 0.29 seconds root@abadmin-Vostro-3500:~# nmap -p 2222 172.20.27.169 -PN Starting Nmap 5.21 ( http://nmap.org ) at 2014-06-14 20:44 CEST Nmap done: 1 IP address (0 hosts up) scanned in 0.28 seconds –  Abhay Jun 14 at 18:45

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.