Fonera

From MioWiki
Jump to: navigation, search

Motion on the Fonera 2.0

Motion installation on Fonera

Motion home page

BusyBox


  • create a script to be executed when a movement is detected, to:
    • upload the picture to our web server
    • send an email (or create a script on the web server to send an email when the picture is uploaded)
  • create a php script on the web server to access the uploaded pictures


Dropbear + scp + public key authentication - 1

~/.ssh$ dropbearkey -t rsa -f id_rsa ~$ dbclient -y -i ~/.ssh/id_rsa user@ip ~$ scp -S dbclient -i ~/.ssh/id_rsa fileName user@ip:/dir

Dropbear + scp + public key authentication - 2

  1. !/bin/sh
  1. on_event_start scp_file "%Y-%m-%d %T"
  1. change to suit your needs:

SCP="/usb/sbin/scp ....."

  1. Destination server

TO="root@www"

  1. Don't change anything below this line

echo -e "This is an automated message generated by motion.\n\nMotion detected: $1\n\n" | $SCP -s "$SUBJECT" $TO


WatchdogScripts

ssh -nNT -R -D546 remote.mydomain.com

http://www.croccobiscotto.it/linux/creare-una-vpn-con-fastweb-vpn-tunnell-ssh/



I wrote a little about tunneling (forward and reverse) back in February. In this case, I'm going to tunnel SSH over a reverse SSH connection -- that is, I'm going to SSH from my inside box (NetBSD) to the web server (betaweb.h-i-r.net), and tell SSH to open a reverse tunnel port (2222) on the web server that connects to the SSH port on the NetBSD box (localhost:22). The -g option allows any remote host to use the tunnel. Otherwise, it will bind only to the localhost interface.

   [axon@NetBSD]$ ssh axon@betaweb.h-i-r.net -g -R 2222:localhost:22
   Last login: Sun Nov 30 14:13:08 2008 from netbsd.labs.h-i-r.net
   [axon@betaweb.h-i-r.net]$ 

Now, from anywhere in the world that can access port 2222 on betaweb.h-i-r.net, I can SSH through my home NAT to get to the internal NetBSD box:

   Chimera:~ axon$ ssh -oPort=2222 axon@betaweb.h-i-r.net
   Password: [my password]
   Last login: Tue Oct 14 19:01:57 2008 from localhost
   NetBSD 4.0.1 (GENERIC) #0: Wed Oct 8 01:06:02 PDT 2008
   Welcome to NetBSD!
   [axon@NetBSD]$


Useful packages

Packages from OpenWrt

monit-nossl

6tunnel

autossh

dropbear

httptunnel

microperl

nagios

openssh-client

ptunnel

rdiff-backup

sshfs

stunnel


scp -S dbclient -i /root/.ssh/dbkey.rsa motion.log roberto@server:/dir/. -P 222