LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-21-2013, 10:27 AM   #1
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Rep: Reputation: 70
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) .
 
Old 05-21-2013, 11:21 AM   #2
hamlindsza
Member
 
Registered: Aug 2012
Distribution: Debian, CentOS
Posts: 74

Rep: Reputation: Disabled
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.
 
Old 05-21-2013, 03:59 PM   #3
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by hamlindsza View Post
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.
 
Old 05-21-2013, 06:38 PM   #4
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 750

Rep: Reputation: 156Reputation: 156
Can you still access the Pi directly? If so login and type

Quote:
ifconfig
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:

Quote:
ssh pi@192.168.1.92
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.
Old 05-22-2013, 07:30 AM   #5
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
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....
 
Old 05-22-2013, 07:43 AM   #6
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
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.
 
Old 05-22-2013, 11:05 AM   #7
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by schneidz View Post
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.
 
Old 05-22-2013, 11:09 AM   #8
Cultist
Member
 
Registered: Feb 2010
Location: Georgia
Distribution: Slackware64 14.2
Posts: 779

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by Completely Clueless View Post
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.
 
Old 05-22-2013, 12:44 PM   #9
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
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.
 
Old 05-22-2013, 01:46 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,692

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Have you tested the wireless signal strength to be sure it will work once bricked up?
 
Old 05-22-2013, 02:49 PM   #11
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Wink

Quote:
Originally Posted by michaelk View Post
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.
 
Old 05-22-2013, 06:32 PM   #12
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 750

Rep: Reputation: 156Reputation: 156
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.
  


Reply



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
LXer: Enter the element14 Pi Day ??Raspberry RoadTest? Challenge for a chance to win a Raspberry Pi c LXer Syndicated Linux News 0 03-08-2012 06:20 AM
Need assistance SSHing into Fedora 14 when Fedora had no problem SSHing into Ubuntu theif519 Fedora 12 06-04-2011 02:34 PM
sshing questions bluknight43 Linux - Newbie 1 02-12-2005 09:06 PM
Problems sshing into box Ripshred Linux - Networking 2 11-08-2003 04:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:45 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