LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-22-2014, 05:21 AM   #1
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,153
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
raspbian: how to log in via ssh through wlan? (dont work; but ssh via LAN works)


hello,
by connecting the raspberry to the LAN i can connect in with
Code:
ssh pi@192.168.178.31
from an asus laptop

I made the setup with wlan and it seems to work (I see the raspberry in my fritzbox router as IP 192.168.178.32).
The setup is:

Code:
# file /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Code:
# file /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
ap_scan=2
network={
ssid="myssidisthere"
scan_ssid=1
psk="myfullpasswordinfulltext"
# Protocol type can be: RSN (for WP2) and WPA (for WPA1)
proto=WPA2
# Key management type can be: WPA-PSK or WPA-EAP (Pre-Shared or Enterprise)
key_mgmt=WPA-PSK
# Pairwise can be CCMP or TKIP (for WPA2 or WPA1)
#pairwise=TKIP
pairwise=CCMP
group=CCMP
#Authorization option should be OPEN for both WPA1/WPA2 (in less commonly used $
auth_alg=OPEN
}
Code:
ssh pi@192.168.178.32
(32 is what I see now as IP in the router). but..
Code:
ssh: connect to host 192.168.178.32 port 22: No route to host
So, how to connect in the raspberry via ssh via wlan ?

I would like to use that raspberry pi as wlan camera and connect to it via ssh.

Last edited by floppy_stuttgart; 03-24-2014 at 01:43 PM.
 
Old 03-22-2014, 10:32 AM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
I think there is a confusion as you have 2 network interfaces on the same subnet.
To test it, shutdown eth0 and try to connect.
If you have further problems, please post complete network config and routing table:
That is, the output of:
#sudo ifconfig
#sudo route
And what distro are you running?
--- edit: Ah, the title says! :-)

Last edited by pingu; 03-22-2014 at 10:56 AM. Reason: Raspbian...
 
Old 03-22-2014, 10:52 AM   #3
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
run this on the pi to make sure it has internet connectivity via wifi (i would disconnect the ethernet cable to cross out that variable):
Code:
echo uname: && uname -a -m -p && echo lspci: && lspci && echo lsusb: && lsusb && echo lsmod: && lsmod && echo ifconfig: && ifconfig && echo ifconfig -a: && ifconfig -a && echo iwconfig: && iwconfig && echo resolv.conf: && cat /etc/resolv.conf && echo route: && route -n && echo ping router: && ping -c 1 `route | awk '/default/ {print $2}'` && echo ping dns-server: && ping -c 1 `awk '/nameserver/ {print $2}' /etc/resolv.conf | head -n 1` && echo ping using ip: && ping -c 1 64.235.229.141 && echo ping using dns: && ping -c 1 www.02144.com
you can also try running
Code:
/usr/sbin/sshd -d -d -d
on the server, and
Code:
ssh -v -v -v
on the client, to see if it is trying to connect.

Last edited by schneidz; 03-22-2014 at 11:00 AM.
 
Old 03-22-2014, 02:49 PM   #4
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,153

Original Poster
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
for both previous posts I will have to connect the raspberry pi to a monitor? (this is what I try to avoid).

Ah, perhaps I should uncomment the eth0 but in that case I cannot connect it anymore to the LAN and I will have to go to a monitor if something dont connect?

#iface eth0 inet dhcp
#iface default inet dhcp

With afresh boot, LAN cable away, the raspberry pi is seen as wlan connected to the router.

EDIT 1: diverse persons has a similar issue "google ssh raspberry wifi"; I have to study the subject and look at the router setup http://www.raspberrypi.org/phpBB3/vi...p?f=28&t=42412 http://raspberrypi.stackexchange.com...interface-only
deleting "iface default inet dhcp" as per recommendation here http://www.penguintutor.com/news/ras...i-wireless-cli
did not help

EDIT 2: Im trying a workaround with avahi; by installing avahi like here recommended an error occur http://www.vascop.com/install-raspbi...-keyboard.html
Code:
pi@raspcamera ~ $ sudo apt-get install avahi-daemon
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  bind9-host geoip-database libavahi-core7 libbind9-80 libdns88 libgeoip1
  libisc84 libisccc80 libisccfg82 liblwres80 libnss-mdns
Suggested packages:
  avahi-autoipd geoip-bin
The following NEW packages will be installed:
  avahi-daemon bind9-host geoip-database libavahi-core7 libbind9-80 libdns88
  libgeoip1 libisc84 libisccc80 libisccfg82 liblwres80 libnss-mdns
0 upgraded, 12 newly installed, 0 to remove and 1 not upgraded.
Need to get 2,960 kB of archives.
After this operation, 8,335 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
WARNING: The following packages cannot be authenticated!
  geoip-database libavahi-core7 libgeoip1 libisc84 libdns88 libisccc80
  libisccfg82 libbind9-80 liblwres80 bind9-host avahi-daemon libnss-mdns
Install these packages without verification [y/N]? y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main geoip-database all 20130213-1 [1,466 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libavahi-core7 armhf 0.6.31-2 [119 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libgeoip1 armhf 1.4.8+dfsg-3 [133 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libisc84 armhf 1:9.8.4.dfsg.P1-6+nmu2+deb7u1 [167 kB]
Get:5 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libdns88 armhf 1:9.8.4.dfsg.P1-6+nmu2+deb7u1 [707 kB]
Get:6 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libisccc80 armhf 1:9.8.4.dfsg.P1-6+nmu2+deb7u1 [32.6 kB]
Get:7 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libisccfg82 armhf 1:9.8.4.dfsg.P1-6+nmu2+deb7u1 [54.0 kB]
Get:8 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libbind9-80 armhf 1:9.8.4.dfsg.P1-6+nmu2+deb7u1 [40.8 kB]
Get:9 http://mirrordirector.raspbian.org/raspbian/ wheezy/main liblwres80 armhf 1:9.8.4.dfsg.P1-6+nmu2+deb7u1 [50.8 kB]
Get:10 http://mirrordirector.raspbian.org/raspbian/ wheezy/main bind9-host armhf 1:9.8.4.dfsg.P1-6+nmu2+deb7u1 [70.9 kB]
Get:11 http://mirrordirector.raspbian.org/raspbian/ wheezy/main avahi-daemon armhf 0.6.31-2 [94.2 kB]
Get:12 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libnss-mdns armhf 0.10-3.2 [23.7 kB]
Fetched 2,960 kB in 10s (285 kB/s)                                             
Selecting previously unselected package geoip-database.
(Reading database ... 69159 files and directories currently installed.)
Unpacking geoip-database (from .../geoip-database_20130213-1_all.deb) ...
Selecting previously unselected package libavahi-core7:armhf.
Unpacking libavahi-core7:armhf (from .../libavahi-core7_0.6.31-2_armhf.deb) ...
Selecting previously unselected package libgeoip1.
Unpacking libgeoip1 (from .../libgeoip1_1.4.8+dfsg-3_armhf.deb) ...
Selecting previously unselected package libisc84.
Unpacking libisc84 (from .../libisc84_1%3a9.8.4.dfsg.P1-6+nmu2+deb7u1_armhf.deb) ...
Selecting previously unselected package libdns88.
Unpacking libdns88 (from .../libdns88_1%3a9.8.4.dfsg.P1-6+nmu2+deb7u1_armhf.deb) ...
Selecting previously unselected package libisccc80.
Unpacking libisccc80 (from .../libisccc80_1%3a9.8.4.dfsg.P1-6+nmu2+deb7u1_armhf.deb) ...
Selecting previously unselected package libisccfg82.
Unpacking libisccfg82 (from .../libisccfg82_1%3a9.8.4.dfsg.P1-6+nmu2+deb7u1_armhf.deb) ...
Selecting previously unselected package libbind9-80.
Unpacking libbind9-80 (from .../libbind9-80_1%3a9.8.4.dfsg.P1-6+nmu2+deb7u1_armhf.deb) ...
Selecting previously unselected package liblwres80.
Unpacking liblwres80 (from .../liblwres80_1%3a9.8.4.dfsg.P1-6+nmu2+deb7u1_armhf.deb) ...
Selecting previously unselected package bind9-host.
Unpacking bind9-host (from .../bind9-host_1%3a9.8.4.dfsg.P1-6+nmu2+deb7u1_armhf.deb) ...
Selecting previously unselected package avahi-daemon.
Unpacking avahi-daemon (from .../avahi-daemon_0.6.31-2_armhf.deb) ...
Selecting previously unselected package libnss-mdns.
Unpacking libnss-mdns (from .../libnss-mdns_0.10-3.2_armhf.deb) ...
Processing triggers for man-db ...
Setting up geoip-database (20130213-1) ...
Setting up libavahi-core7:armhf (0.6.31-2) ...
Setting up libgeoip1 (1.4.8+dfsg-3) ...
Setting up libisc84 (1:9.8.4.dfsg.P1-6+nmu2+deb7u1) ...
Setting up libdns88 (1:9.8.4.dfsg.P1-6+nmu2+deb7u1) ...
Setting up libisccc80 (1:9.8.4.dfsg.P1-6+nmu2+deb7u1) ...
Setting up libisccfg82 (1:9.8.4.dfsg.P1-6+nmu2+deb7u1) ...
Setting up libbind9-80 (1:9.8.4.dfsg.P1-6+nmu2+deb7u1) ...
Setting up liblwres80 (1:9.8.4.dfsg.P1-6+nmu2+deb7u1) ...
Setting up bind9-host (1:9.8.4.dfsg.P1-6+nmu2+deb7u1) ...
Setting up avahi-daemon (0.6.31-2) ...
[ ok ] Reloading system message bus config...done.
insserv: warning: script 'mathkernel' missing LSB tags and overrides
[ ok ] Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon.
Setting up libnss-mdns (0.10-3.2) ...
First installation detected...
Checking NSS setup...
pi@raspcamera ~ $ sudo insserv avahi-daemon
insserv: warning: script 'mathkernel' missing LSB tags and overrides

Last edited by floppy_stuttgart; 03-23-2014 at 02:47 PM.
 
Old 03-23-2014, 02:58 PM   #5
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,153

Original Poster
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
TRY NUMBER 1:
Code:
ssh -v -v -v pi@192.168.178.32
(on the client; I see the "32" as connected in my router via WLAN))
gives the output
Code:
OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.178.32 [192.168.178.32] port 22.
debug1: connect to address 192.168.178.32 port 22: No route to host
ssh: connect to host 192.168.178.32 port 22: No route to host

TRY NUMBER 2:
Code:
ssh -v -v -v pi@raspcamera
gives (so: avahi seems to work)
Code:
OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to raspcamera [192.168.178.32] port 22.
debug1: connect to address 192.168.178.32 port 22: No route to host
ssh: connect to host raspcamera port 22: No route to host
(I am still headless, so can only work from the client. Next step will be to find a screen and make the command recommended on the raspberry pi)

Last edited by floppy_stuttgart; 03-23-2014 at 03:10 PM.
 
Old 03-23-2014, 03:08 PM   #6
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Quote:
Originally Posted by floppy_stuttgart View Post
Im trying a workaround with avahi; by installing avahi like here recommended an error occur
What error? All I see is a warning about LSB overrides - that's not fatal, just a warning. The init-script lacks some information about what services to start before, what it depends on and such.
It will still startup fine.

And how about this:
"If you have further problems, please post complete network config and routing table:
That is, the output of:
#sudo ifconfig
#sudo route "
 
Old 03-23-2014, 03:14 PM   #7
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,153

Original Poster
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by pingu View Post
That is, the output of:
#sudo ifconfig
#sudo route "
I know I know.. the raspberry pi is still headless, so I cannot start it at a screen and make that commands when it is in the WLAN. I ordered a cable for a pc screen I have and will connect the raspberry as soon it arrives (no way to connect to the TV and HDMI else the family is NOT happy).

It is perhaps a weird router.. http://www.raspberrypi.org/forum/vie...p?f=29&t=23556

Last edited by floppy_stuttgart; 03-23-2014 at 03:19 PM.
 
Old 03-23-2014, 03:34 PM   #8
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
I see your problem!
It might still be helpful to get that info when the pi is connected to both LAN & WAN.
Now how is your network setup? You have a router, a WAP etc - exactly what do you have, how is it configured, to what switches/routers/WAP is your pi connected? Could you give us a detailed network diagram?
(And don't make your family unhappy - you'll need them some day! ;-) )
 
1 members found this post helpful.
Old 03-24-2014, 01:42 PM   #9
floppy_stuttgart
Senior Member
 
Registered: Nov 2010
Location: EU mainland
Distribution: Debian like
Posts: 1,153

Original Poster
Blog Entries: 5

Rep: Reputation: 107Reputation: 107
Solved.
The router FRITZBOX 7170 setup had to be changed in "boxes can communicate via WLAN together"
It was not the case till now (my client was connected to the router via WLAN; the raspberry too).

Last edited by floppy_stuttgart; 03-24-2014 at 01:44 PM.
 
  


Reply

Tags
connecting, raspberry pi, ssh, wlan



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
raspbian/scratch/ssh -X timl Linux - Software 2 06-27-2013 11:14 PM
[SOLVED] SSH no route to host error. can ssh outside lan, but not to clients on lan... jmd9qs Linux - Networking 3 01-21-2012 10:28 AM
how to log ssh activity in /var/log/ssh/ssh*.log MrUmunhum Linux - Server 3 11-02-2011 02:25 AM
ssh works good from LAN but can't login from WAN akrawiec Linux - Security 4 01-10-2007 02:03 PM
SSH in LAN works, but not from outside max2004 Linux - Networking 4 07-22-2006 11:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration