[clue] Automatic /smb fs, just like /net

David L. Willson DLWillson at TheGeek.NU
Tue Jul 24 10:12:50 MDT 2012


The autofs configuration below allows any user to create a .secret.txt in $HOME and then depend on the autofs daemon to perform mounts in the /smb tree using their credentials, like this: 

ls /smb/server/share/dir1/.../dirN 

$ cat /etc/auto.master 
<snip> 
/smb /etc/auto.smb.top 
<snip> 

$ cat /etc/auto.smb.top 
* -fstype=autofs,-Dhost=& file:/etc/auto.smb.sub 

$ cat /etc/auto.smb.sub 
* -fstype=cifs,credentials=${HOME}/.secret.txt,uid=${UID},gid=${EUID} ://${host}/& 



Yes, it's got problems and implications: 
- root can read that .secret.txt file and get direct access to the user's CIFS credentials. 
- a second user on the system trying to access an already-mounted share will be blocked by the previous auto-mount. 

... but it's pretty sweet for 80+% of use-cases. 

-- 
David L. Willson 
Trainer, Engineer, Enthusiast 
RHCE Network+ A+ Linux+ LPIC-1 Ubuntu 
Mobile 720-333-LANS(5267) 

This is a good time for a r3VOLution. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cluedenver.org/pipermail/clue/attachments/20120724/a7e1acc7/attachment.html 


More information about the clue mailing list