bearathustra
Posts: 2
Joined: Thu Aug 15, 2013 2:04 am

SSH only works with wireless laptop

Mon Aug 19, 2013 3:55 am

SSH (using putty) and remote desktop work great with wireless laptop on local network but nothing else can SSH into the Pi; previously was able to SSH in from Android phone using JuiceSSH.

Current set up:
Pi (using Rasbian) directly connected to router
laptop (win 7) wireless
phone (Jelly bean 4.1.1) wireless

[email protected] ~ $ ifconfig
eth0 Link encap:Ethernet HWaddr b5:27:eb:8d:3e:fb
inet addr:192.168.1.73 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:656 errors:0 dropped:0 overruns:0 frame:0
TX packets:142 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:47028 (45.9 KiB) TX bytes:16539 (16.1 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

I had previously set static IP on Pi but decided to try dhcp to see if that might be the culprit that is preventing SSH access via Android phone but this did not solve it. Set static IP through router instead and left Pi using dhcp, could this affect anything?

etc/networks/interfaces set up below:

auto lo
#auto eth0

iface lo inet loopback
iface eth0 inet dhcp
#iface eth0 inet static
#address 192.168.1.79
#netmask 255.255.255.0
#network 192.168.1.0
#broadcast 192.168.1.255
#gateway 192.168.1.254


allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Used installed tightvncserver but decided to kill it and install xrdp and use Windows remote desktop app from accessories. I did give Xauthority back to Pi after logging on to Pi directly with keyboard/mouse and TV and noticing the Pi didn't have access/authority for Xauthority; also could not access internet or package updates locally on Pi until after giving Xauthority back to Pi and rebooting.

I'm sorry if some of my descriptions are not technically accurate. I've just stated using the Pi since yesterday and besides installing Ubuntu on an old computer that refused to run windows anymore a few years ago I'm a noob with Linux too.

I just killed xrdp and rebooted (which I didn't think would matter) but the problem persists. I can only remotely access the Pi through my wireless laptop.

drgeoff
Posts: 10538
Joined: Wed Jan 25, 2012 6:39 pm

Re: SSH only works with wireless laptop

Mon Aug 19, 2013 11:41 am

Is the "nothing else" (that can ssh into the RPi) only the Android phone or are there more devices which cannot? If just the phone, you do realise that only when it has a Wi-Fi connection to your router/AP will it be able to ssh to the RPi? If the phone's IP connectivity is via a cellular network you would need to have appropriate port forwarding configured on your router.

Do you have any 'ping' app on the phone? Can you ping both the laptop PC and the RPi?

What error message is the phone giving when you try to ssh to the RPi?

bearathustra
Posts: 2
Joined: Thu Aug 15, 2013 2:04 am

Re: SSH only works with wireless laptop

Mon Aug 19, 2013 2:47 pm

Thanks for the quick reply, I should have clarified that I was only connecting to the pi via android phone through the local network . . . facepalm . . . after reading the reply I realized that the wifi on the android phone had at some point turned off (I failed to check this since I always keep wifi On on the Android). The other "computer" was a tablet that I was also previously able to SSH into the Pi with... turns out my wife had reset the tablet and unknowingly connected to a neighboring wifi connection not knowing I had renamed the router a couple weeks ago, so it was also not connected to the local network the Pi is on. Problem solved.

However, I've been interested in getting a static IP address for the Pi so I can SSH into the Pi from outside the local network. Is there a way of doing this without paying my ISP extra for an external static IP address? It is unclear to me how the Pi can be used as a web server that can be accessed outside of a local network without having an external static IP address or paying for a registered domain name.

User avatar
ddxfish
Posts: 75
Joined: Wed Aug 07, 2013 5:17 pm
Location: Florida
Contact: Website AOL

Re: SSH only works with wireless laptop

Mon Aug 19, 2013 3:01 pm

-setup static IP for the Pi using your router and have the Pi use DHCP to get its IP
-On your router, find port forwarding
-add entries for each service you want your Pi to run and direct them to the Pi's IP address.

port 22 tcp directs to the Pi's IP
port 80 tcp
port 443 tcp

This will make your external IP direct all SSH and HTTP traffic to ur Pi. Get your external IP http://www.etcwiki.org/ip.php and you can use that external IP with JuiceSSH (my favorite ssh on android also!). You can access this from anywhere in the world with internet.

Note: This is usually a bad idea on the default Pi (it has no firewall by default) so you will be a target for any bots/scripts/hackers that wanna hurt you. Make sure you setup Apache properly, and I recommend using private keys for login to SSH for added security from snoopers.
http://www.etcwiki.org/wiki/Raspberry_P ... Keys_Login
My Pi Guides: http://www.etcwiki.org/wiki/Category:Raspberry_Pi
My AIM screen name: ddxfish
Always happy to chat about the Pi!

drgeoff
Posts: 10538
Joined: Wed Jan 25, 2012 6:39 pm

Re: SSH only works with wireless laptop

Mon Aug 19, 2013 10:23 pm

bearathustra wrote:However, I've been interested in getting a static IP address for the Pi so I can SSH into the Pi from outside the local network. Is there a way of doing this without paying my ISP extra for an external static IP address? It is unclear to me how the Pi can be used as a web server that can be accessed outside of a local network without having an external static IP address or paying for a registered domain name.
The usual way of doing this is to use a service such as those provided by the likes of dyndns.org, noip.com and dtdns.com. I believe the latter two still offer a free version. You get from them a 'domain name' which points to the public IP address of your router. Many routers incorporate a client which automatically updates their DNS server if/when your public IP address changes. Look for 'dynamic DNS' in your router's manual or admin web pages. If your router does not have that support it may be possible to run a client on the RPi. (Those companies usually have clients for x86 computers.)

External access is then via the fixed domain name, without being concerned with the actual IP address.

zedin
Posts: 38
Joined: Tue Oct 18, 2011 1:20 pm

Re: SSH only works with wireless laptop

Mon Aug 19, 2013 10:43 pm

For your IP it also might depend on your service provider. With my cable company they say you don't get a static IP but it doesn't ever change. I just setup my router to automatically assign a certain IP to the PI based in its mac address and then add the port forwarding.

One point on the port forwarding.. DON'T use the default ports unless you really really have to. If you just want to ssh in make the incoming side port some random number within the proper range and don't use 22. At least make it difficult for things to get into your system. If you leave it at 22 and don't have a firewall you are a sitting duck.

Return to “Troubleshooting”