Easily mount SMB Share on Per User Basis

Gabriel Dragffy dragffy at yandex.ru
Wed Mar 21 21:40:17 UTC 2007


Matthew Flaschen wrote:
> The below is a hack :) :
> 
> You should just be able to use /etc/fstab
> (http://www.tuxfiles.org/linuxhelp/fstab.html).  For some reason smbfs
> needs root privileges so doing it on login won't work.  Try something like:
> 
> //smb.yourserver.edu/	/home/username/smb	smbfs
> username=username,uid=1000,gid=1000,fmask=700,password=PASSWORD	0	0
> 
> You need to create a separate entry with the username, password,
> mountpoint, uid & gids for each users.  That means all the directories
> will be mounted at the same time (which might be impossible if we're
> talking about a large number of users), but unix permissions should
> prevent users from seeing each others files.
> 
> Also, make sure you run
> 
> sudo chmod go-r /etc/fstab
> 
> to stop users (in theory...) from seeing each others passwords.
> 
> Matthew Flaschen
> 
> 

I've been trying to do something like this on my machine too. I edit 
fstab as necessary, and then run sudo mount -a, it always gives me an 
error about bad fs, bad superblock, bad option etc. I have tried every 
combination I can think of :(




More information about the ubuntu-users mailing list