How to access NATted cameras remotely over http/ssh/sshuttle

Add any particular hints or tricks you have found to help with your ZoneMinder experience.
Post Reply
linforpros
Posts: 39
Joined: Fri Jan 29, 2016 6:12 pm

How to access NATted cameras remotely over http/ssh/sshuttle

Post by linforpros »

Hello I found a way to access cameras and configure them via http from behind NAT and without any port forwarding set on the router/firewall.

Assumptions:
1. Remote server has cameras attached to the interface in the network of 192.168.2.0/24
2. Remote server is accesible from the internet via ssh on port 22 via public IP or domain name.
3. Remote server needs python-2.7 or python-3.5 installed.

The Steps.
1. Install and configure sshd on the remote computer/zoneminder machine. This is standard on most distributions.
2. Configure sshd on the remote machine to allow private/public key login. Dissalow password login, no root login. See your distro docs.
3. Install sshuttle on the client computer, make sure ssh client is available here, as well. Latest version of sshuttle as of July 25 2016 is 0.78.
4. Become root on the client computer.

Code: Select all

# sshuttle -l 0.0.0.0 -vr user@sshserver:22 192.168.2.0/24 -e "ssh -i /home/user/.ssh/rsa_id"
Now you can fire up your browser on the client computer and if your camera has an IP of 192.168.2.14 on the remote machine then do http://192.168.2.14 on the client machine and voila, you can do everything as if you were there.

5. After you finish the http sesssion with your camera you can go back to the ssh terminal and do CTRL+C to terminate the VPN.

more info
http://sshuttle.readthedocs.io/en/latest/
https://github.com/apenwarr/sshuttle
best regards
LinforPros
Post Reply