Link to home
Create AccountLog in
Linux

Linux

--

Questions

--

Followers

Top Experts

Avatar of code4
code4

cifs mount with folder permissions?
I would like to mount a windows drive and create folder permission based on the user name.

The folder is a drive named /users and each subfolder is a user name.

On the linux side, I would like each folder to have rwx permission for the user and only rx permission for
other users.

Currently, I do a cifs mount configured in the fstab as follows:

//linuxsystem/users   /mounts/users    cifs    iocharset=utf8,credentials=/root/.cifscredentials,noperm,uid=10004,gid=10004  0       0

This mounts the windows systems with all users having rwx on all folders.
No changes are possible with chmod or chown.

How can I fix this?

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


ASKER CERTIFIED SOLUTION
Avatar of Trenton KnewTrenton Knew

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of MazdajaiMazdajai🇺🇸

Try

//linuxsystem/users   /mounts/users    cifs    iocharset=utf8,credentials=/root/.cifscredentials,noperm,uid=10004,gid=10004,file_mode=0775,dir_mode=0775  0       0

Open in new window


Avatar of gheistgheist🇧🇪

it is unix uid and gid

so change uid=0,gid=(?users?),perm=0750 (users can read files, while httpd cannot)
mount accesses share with credentials from .cifscredentials, and users according to permissions in fstab.

Avatar of code4code4

ASKER

Thanks. Changes to fstab are not working. They give every
user rw access to every directory. I want each user to only
have rw to their own directory.
How can I fix this?

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of gheistgheist🇧🇪

So each user must give up their password....

Avatar of MazdajaiMazdajai🇺🇸

You can try changing the file_mode or dir_mode option to 700. Can you provide the output of the permission?

//linuxsystem/users   /mounts/users    cifs    iocharset=utf8,credentials=/root/.cifscredentials,noperm,uid=10004,gid=10004,file_mode=0700,dir_mode=0700  0       0

Open in new window

Linux

Linux

--

Questions

--

Followers

Top Experts

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.