Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-21-2013, 10:27 AM
|
#1
|
Member
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 922
Rep:
|
SSHing into Raspberry Pi
Hi guys,
I've set up a Pi as a *deeply* embedded controller where no physical access to it can be obtained without a *vast* amount of hassle, effort and time. It's running a script I wrote under Rapsbian for which it needs internet access via a wireless card that's plugged into it. When the power is switched on, the Pi boots to a CLI prompt in run level 4 (I think it's 4; the level before startx command is normally given). By this time it's got its wireless connection and all should be well. The wireless is its *only* connection to the outside world apart from the power supply.
Question is: if something should go wrong in future, can I SSH into the Pi via its wireless card net connection and see what's going on from a remote PC? And can I still get access if its wireless is up and running but it has no net connection - if I'm within a few feet of course?
Disclaimer: I know *nothing* about SSH so if this question is badly put, then I plead ignorance (as usual)  .
|
|
|
05-21-2013, 11:21 AM
|
#2
|
Member
Registered: Aug 2012
Distribution: Debian, CentOS
Posts: 74
Rep: 
|
Yes, but you should know the IP assigned to your wireless card. Some ISPs do not assign the same IP allways.
If the wireless card isn't connected to the Internet, you would not be able to access the pi via SSH. If this happens you could try connecting the Ethernet port & SSH into the pi.
|
|
|
05-21-2013, 03:59 PM
|
#3
|
Member
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 922
Original Poster
Rep:
|
Quote:
Originally Posted by hamlindsza
Yes, but you should know the IP assigned to your wireless card. Some ISPs do not assign the same IP allways.
If the wireless card isn't connected to the Internet, you would not be able to access the pi via SSH. If this happens you could try connecting the Ethernet port & SSH into the pi.
|
Wireless card IP. Is that the same thing as its MAC address?
As for connecting to the ethernet port, that's impossible since wireless is the only means of I/O with this application.
|
|
|
05-21-2013, 06:38 PM
|
#4
|
Member
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 758
Rep: 
|
Can you still access the Pi directly? If so login and type
You will get something like
Quote:
pi@raspbmc:~$ ifconfig
eth0 Link encap:Ethernet HWaddr ff:ff:ff:ff:ff:ff
UP BROADCAST MULTICAST MTU:1500 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:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:104 (104.0 B) TX bytes:104 (104.0 B)
wlan0 Link encap:Ethernet HWaddr ff:ff:ff:ff:ff:ff
inet addr:192.168.1.92 Bcast:10.1.1.255 Mask:255.255.255.0
inet6 addr: ffff::ffff:fff:fe1d:fff6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1074671 errors:0 dropped:1714489 overruns:0 frame:0
TX packets:565134 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1288468888 (1.1 GiB) TX bytes:50970963 (48.6 MiB)
|
Look at the area labelled wlan0 and the HWaddr is your MAC address (I have just set mine to all "ff", yours will look different). I have set up this Pi to have a static IP address of 192.168.1.92 (choose an address outside of your DHCP range) so everytime the Pi boots it will get this address. I had problems with setting a static IP add via the Pi so I allocated the IP address to the MAC address via my wifi router. Then:
and you are in.
HTH. I note you are assuming no net access but I am assuming a router is involved somewhere?
Cheers
|
|
1 members found this post helpful.
|
05-22-2013, 07:30 AM
|
#5
|
Member
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 922
Original Poster
Rep:
|
Thank you, Tim. Yes, wireless router a few feet away. I think I'll do the same as you and change it to all 'f's whilst I still have access to the pi and before I seal it away to its doom as a blind, deaf and dumb, permanently embedded device....
|
|
|
05-22-2013, 07:43 AM
|
#6
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
I would be more concerned with: what if someone unplugs the router ?
also, obviously you will need to do port forwarding on your router to pass thru port 22 traffic.
Last edited by schneidz; 05-22-2013 at 07:56 AM.
|
|
|
05-22-2013, 11:05 AM
|
#7
|
Member
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 922
Original Poster
Rep:
|
Quote:
Originally Posted by schneidz
I would be more concerned with: what if someone unplugs the router ?
also, obviously you will need to do port forwarding on your router to pass thru port 22 traffic.
|
No worries on the router; I'm the only one with access to it. No idea what your other remark means but I guess I can search for port 22 traffic on the net. It's not a port number I'm familiar with, TBH.
|
|
|
05-22-2013, 11:09 AM
|
#8
|
Member
Registered: Feb 2010
Location: Virginia
Distribution: Slackware64 14.2
Posts: 779
Rep: 
|
Quote:
Originally Posted by Completely Clueless
No worries on the router; I'm the only one with access to it. No idea what your other remark means but I guess I can search for port 22 traffic on the net. It's not a port number I'm familiar with, TBH.
|
Port 22 is the port SSH listens on. For a computer outside your lan to be able to SSH into the pi, your router would need to forward port 22 requests to the pi's local IP address.
|
|
|
05-22-2013, 12:44 PM
|
#9
|
Member
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 922
Original Poster
Rep:
|
Ok, getting the picture a bit better now. Well, all that matters at this stage is that (from the above comments) the walled-up Pi will still be accessible via wireless provided I know the IP of the pi's wireless card and use port 22 of my router to connect to it.
I can worry about the finer details if the setup ever goes wrong in future. The important thing is I have the peace of mind in knowing I won't have to break through brick walls to get physical access to the Pi for debugging purposes.
|
|
|
05-22-2013, 01:46 PM
|
#10
|
Moderator
Registered: Aug 2002
Posts: 26,807
|
Have you tested the wireless signal strength to be sure it will work once bricked up?
|
|
|
05-22-2013, 02:49 PM
|
#11
|
Member
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 922
Original Poster
Rep:
|
Quote:
Originally Posted by michaelk
Have you tested the wireless signal strength to be sure it will work once bricked up?
|
Yes, it was one of the very first things I checked, thanks.
|
|
|
05-22-2013, 06:32 PM
|
#12
|
Member
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 758
Rep: 
|
Wooahhh, maybe I phrased my response wrongly. In my post I changed the MAC address display to ff's to obscure my real MAC address. On the router you tie up a user defined static IP address to the MAC address you see in ifconfig.
I think you are on the right track though - you know your IP address and should be ready to go.
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 06:39 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|