LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Mounting CIFS as normal user (https://www.linuxquestions.org/questions/linux-networking-3/mounting-cifs-as-normal-user-446162/)

abovett 05-18-2006 03:42 PM

Mounting CIFS as normal user
 
I currently use a script to mount a set of SMB shares as a regular (non-root) user, by setting smbmnt and smbumount SUID root (I initially learnt this trick from LinNeighborhood ). The script prompts me for the password and then uses it to mount the shares.

However, I've been reading that CIFS is replacing smbfs and I ought to use that. Can someone tell me how I can use CIFS as a normal user?

Andy B

spooon 05-18-2006 04:39 PM

This is how I mount CIFS as non-root user: I make the "/sbin/mount.cifs" and "/sbin/umount.cifs" programs setuid root. And then in my /etc/fstab I gave the "user" or "users" option in mount options (I'm not sure what the difference is between those two) and then I changed ownership of the mountpoints to my user. Then I just do "mount <whatever>" from my user and it works.

abovett 05-18-2006 04:58 PM

Oh yes - setting mount.cifs and umount.cifs setuid root might do it - should have thought of that. Anyone know if there are any security issues with this? I recall that with smbfs, smbmount calls smbmnt, and there's some warning about _not_ setting smbmount setuid root, but it's OK with smbmnt. Is there anything similar with mount.cifs?

In the middle of something else right now, but I'll give this a go at some point and report back.

Andy


All times are GMT -5. The time now is 05:44 PM.