You are not logged in.
Hi folks, not quite my first post here, but close, so forgive me if I miss something that should be included...
I have a little QNAP TS-110 at home that I use as a backup server/media server/seedbox/print server and I got tired of manually mounting the share, so i figured I'd share the solution I came up with, as it's been really nice to always have access to my larger drive when I'm away from home.
The script is pretty simple, it just does a quick check for the router (gateway) MAC address, and if it's the MAC address of your home router it mounts the drive over NFS (could work for SMB or whatever else, though you'd have to modify /etc/fstab). If my home router's mac is not found as the gateway mac, the script defaults to mounting the drive over sshfs.
first
#!/bin/bash
#make script executable at /etc/NetworkManager/dispatcher.d/50-mount-remote
#customize below for your setup
gateway=`ip route show 0.0.0.0/0 | awk ‘{print $3}’`
mactest=$(arp -n -a $gateway | awk ‘{print $4}’)
targetmac="00:00:00:00:00:00"
homeupcommand="mount /home/nathan/remote"
homedowncommand="umount /home/nathan/remote"
awayupcommand="cd /home/nathan && sudo -u nathan sshfs nathan@your.dyndns.com:/home/nathan /home/nathan/remote"
awaydowncommand="cd /home/nathan && sudo -u nathan fusermount -u /home/nathan/remote"
#
# should not need to modify below here unless you know what you are doing
#
if [ $mactest==$targetmac ]
then
case "$2" in
up)
$homeupcommand
;;
down)
$homedowncommand
;;
esac
else
case "$2" in
up)
$awayupcommand
;;
down)
$awaydowncommand
;;
esac
fi
exit $?and the /etc/fstab entry... (the noauto mount option is the important part)
homenet:/home/nathan /home/nathan/remote nfs noauto,rw,rsize=8192,wsize=8192,timeo=14,intr 0 0*note: this does depend on the use of NetworkManager, though the task could still be reworked for ifup/ifdown use instead
enjoy! within a few seconds of establishing a network connection, you should have remote access to your server/share drive!
Last edited by nathwill (2010-11-07 03:40:42)
NOTICE: alloc: /dev/null: filesystem full
Offline
I realize the post is quite old but I was just curious as to what steps you took to get your QNAP to allow normal users to ssh in?
Offline
The OP hasn't posted here since February 2012, so you might have more luck sending him an email, or trying his web site (it's in his profile): http://crunchbanglinux.org/forums/user/7304/
Or post your question with more details in a separate topic, where others may be able to help you.
And BTW, welcome to #!
Want Waldorf, but with sid and systemd? Try Darkside.
Offline
i'm here!
i flashed debian onto my qnap as described on this site (select the appropriate model)
once you have debian installed, the rest is easy 
NOTICE: alloc: /dev/null: filesystem full
Offline
i'm here!
i flashed debian onto my qnap as described on this site (select the appropriate model)
once you have debian installed, the rest is easy
Yes, of course.
Thanks for the reply. I managed to find another post that didn't involve too many changes.
P.S> Debian is the best 
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.