Koozali.org: home of the SME Server

mount --bind question

Offline Sparkey

  • **
  • 27
  • +0/-0
mount --bind question
« on: June 09, 2014, 08:38:23 PM »
Hello everyone,

New forum member and Smeserver 8.1 user.

I have not worked with a linux/unix environment since back in the SCO/Unix System V days.  That being said, I am duly impressed with the stability, strength and consistency of this distribution and how everything works together.

My question has to do with the mount --bind question.

First question, more a statement, is that I found that a mount --bind command only lasts until the next server reboot.  My question is would a mou-bi command be better setup in fstab or as a secondary script that runs at boot ?

Secondly,  I was trying to come up with a way to have allowed file share access to clients (remote from internet), but at the same time allow employees local access these same shares to grab art files customers would upload.

I have settled on the following set-up:

I installed the following contribs:
--Sharedfolders
--Webshare

I then setup a group called ftpusers that has read only access.
Created a Sharedfolder named "fileshare" and gave read only permission to the ftpusers group.
Created a Webshare named "ccccccc" and added a user name / password for that share.
Accessed the sharedfolder "fileshare" via a mapped drive f: on my WinXP machine and created a folder named "ccccccc"

Lastly issued a mount --bind   /opt/webshare/ccccccc/files   /home/e-smith/files/shares/fileshare/files/ccccccc

So far, web users have access to their share, and samba users can access that webshare by clicking on the named folder in the Sharedfolder mapped to their f: drive on XP Machines.

My question:  Are their any security concerns I should have using this setup that the average person would not be aware of ?

Mark


« Last Edit: June 11, 2014, 09:11:41 PM by Sparkey »

Offline mmccarn

  • *
  • 2,656
  • +10/-0
Re: mount --bind question
« Reply #1 on: June 13, 2014, 02:38:44 PM »
First question: ways to run a command at boot:
The "SME" way to do run a command at boot is to modify the 'local' event.  The 'local' event is run at boot after all SME services have been started.

There's a description in this wiki article about creating a local event to mount network shares - the same process could be used for your command:
http://wiki.contribs.org/Mount_Network_Shares#Modify_the_SME_local_event

You can use the cron '@reboot' schedule.  I use cron to start dropbox at each reboot:
- edit the root crontab using 'crontab -e'
- add a line similar to my dropbox startup (but which runs your mount --bind):
Code: [Select]
@reboot /usr/local/bin/python2.7 /root/dropbox.py start

You could customize /etc/rc.d/rc.local - but I'm not sure what will happen to this file during 'signal-event post-upgrade' or during updates or upgrades.  It is not templated, so it is likely to be overwritten by a SME update at some point.

Second question: security of your mount --bind config:
(I have no useful input on this)