LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-13-2009, 08:19 PM   #1
wgcampbell
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Rep: Reputation: 0
Accessing hidden camera


I have a small network behind a wireless router that I don't control. I pick up the signal with my own wireless router, then run a small internal network from my wireless router (including a linux box and a wireless web camera). I would like to view (browse to) the web cam from the outside.

I was thinking of setting up a reverse ssh tunnel from the linux box on the internal network to another linux box at my office (which would act as my "outside" access). This would let me get into the network (to my linux box) from the outside but then I somehow need to redirect that connection to the camera (web server).

Suggestions would be appreciated.
 
Old 01-14-2009, 12:45 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Hi,

Welcome to LQ!

Would

Code:
ssh -N -R remoteport:wcserver:wcport username@remotehost
work?

I am designating your ("outside") office as remotehost where sshd will be listening for connections on remoteport. Likewise wcserver is the machine hosting the webcam on wcport. (If the ssh connection is originating from the machine with the webcam, then use "localhost" or 127.0.0.1 for wcserver.)
 
Old 01-14-2009, 03:34 PM   #3
wgcampbell
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Actually there is no machine hosting the webcam - it is a stand alone wireless camera with a web server interface. Your reverse SSH tunnel works, but I then need some way to then redirect the port 80 requests coming in over to the webcam??
 
Old 01-14-2009, 04:53 PM   #4
hvc123
Member
 
Registered: Jun 2004
Posts: 31

Rep: Reputation: 16
its ugly but cant u open another ssh port redirect in another terminal to port 80
 
Old 01-14-2009, 08:22 PM   #5
wgcampbell
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Original Poster
Rep: Reputation: 0
I'm not quite sure how to do what you're suggesting: "open another ssh port redirect in another terminal to port 80"

Somehow I need to extend the reverse ssh connection to the web cam??
 
Old 01-15-2009, 07:16 AM   #6
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by wgcampbell View Post
but I then need some way to then redirect the port 80 requests coming in over to the webcam??
I'm not sure I understand. Using the terminology in post #2, wcserver would be the IP address of your webcam and wcport would be the port it listens on (port 80?).

Are you talking about getting requests on what I called remotehost to remoteport? I would think you could REDIRECT with iptables for that. You might have to use bind_address as explained in ssh's man page:

Code:
      -R [bind_address:]port:host:hostport
             Specifies that the given port on the remote (server) host is to
             be forwarded to the given host and port on the local side.  This
             works by allocating a socket to listen to port on the remote
             side, and whenever a connection is made to this port, the connec-
             tion is forwarded over the secure channel, and a connection is
             made to host port hostport from the local machine.

             Port forwardings can also be specified in the configuration file.
             Privileged ports can be forwarded only when logging in as root on
             the remote machine.  IPv6 addresses can be specified by enclosing
             the address in square braces or using an alternative syntax:
             [bind_address/]host/port/hostport.

             By default, the listening socket on the server will be bound to
             the loopback interface only.  This may be overriden by specifying
             a bind_address.  An empty bind_address, or the address '*', indi-
             cates that the remote socket should listen on all interfaces.
             Specifying a remote bind_address will only succeed if the
             server's GatewayPorts option is enabled (see sshd_config(5)).
 
Old 01-15-2009, 10:31 PM   #7
wgcampbell
LQ Newbie
 
Registered: Jan 2009
Posts: 7

Original Poster
Rep: Reputation: 0
After tinkering with reverse tunnel ssh and iptables, I discovered that the whole thing could be accomplished with remote tunnel ssh using a "bind_address". The final solution was:

Code:
$ ssh -R [Offsite SSH Server IP]:[Offsite Accepted Port]:[Internal webcam IP]:[Webcam Port] [Offsite URL]
You must have GatewayPorts set to "yes" (in your sshd.config file) in order to effectively utilize this solution. Thanks much for all of the suggestions.
 
  


Reply

Tags
remote, reverse, ssh


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
problem accessing FUJI finepix Z20 camera through USB std0ut Linux - Hardware 3 08-23-2008 08:12 PM
LXer: Accessing the Nokia N800 Camera LXer Syndicated Linux News 0 12-04-2007 02:30 AM
Permissions accessing USB Digital Camera edmundo_ba Slackware 6 11-01-2005 01:32 PM
Accessing Serial Camera Vincent_Vega Linux - Hardware 3 01-11-2004 11:26 AM
accessing digital camera as user, bennythepitbull Slackware 1 11-04-2003 02:29 AM


All times are GMT -5. The time now is 05:48 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration