[Tfug] Running logout scripts as root?
Christopher Robbins
robbinsc at gmail.com
Sun Aug 10 10:09:32 MST 2008
On Sat, Aug 9, 2008 at 4:52 PM, John Gruenenfelder <johng at as.arizona.edu>wrote:
> On Sat, Aug 09, 2008 at 03:37:45PM -0700, Christopher Robbins wrote:
> > I've got a logout script that I've written...It connects to a SMB file
> > share (via mount-cifs) and then uses rsync to sync the directories.
> > I'm using this as a way for my users to access their files offsite -
> > they
> > connect to the SSH server, copy files, then when they logout, we sync
> > their file shares to this SSH server.
> > Problem is...one needs to be root to run mount. Aside from adding
> > my list of users to sudoers or giving everyone access to mount, is
> > there
> > an easy way to have the script executed as root?
> > TIA
> > - Chris
>
> If the share can be specified in /etc/fstab, you can add the 'user' option
> which will allow users to mount/unmount that particular item. Of course,
> if
> you're mounting something like smb:/users/bob/ (I don't know what the
> proper
> SMB/CIFS mount syntax is) then this may or may not work depending on how
> many
> users you have.
>
I didn't want to manually have to enter each user into /etc/fstab (lazy, I
know :) ), but
I found a workaround.
I found mount.cifs./umount.cifs and chmod-ed them to u+s. I've established
mount points
that they own, and the bash_logout script can mount their shares and then
sync the windows
and linux sides.
I don't think that's a security issue - they can only mount their shares to
their designated mount
points, and they don't have any extra rights as users...
- Chris
--
Chris Robbins
Systems Programmer
Department of English - University of Arizona
http://www.homerengineeringcorp.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tfug.org/pipermail/tfug_tfug.org/attachments/20080810/48eacd6e/attachment-0002.html>
More information about the tfug
mailing list