Take the 2-minute tour ×

I use Samba to access my fileserver. I have several shares, and I use local users to log in ("security = user").

Let's say the share "SpShare" is located at /SpShare. All files within the /SpShare directory are owned by Alice, and only Alice can read/write them. I want two things:

  • All users that have access to "SpShare" should be able to read all files in /SpShare.
  • All writes by users in "SpShare" should create files owned by Alice.

That is, even if I'm logged in as Betty, as long as Betty is a "valid user" of the SpShare share, I want all of Betty's file operations within that share to be carried out as if the user was logged in as Alice.

How can I accomplish this, without just setting "force create mode = 777" (I'd rather not do this)?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Use the force user directive instead in the definition of the share.

share|improve this answer
add comment

I don't recommend that as a course of action.

I recommend setting the files to 2770 access mode for directories and executables and 2660 for non-executables, and recursively setting the group ownership to a group that is common amongst all the users accessing that share.

The '2' in front of the more common mode setting forces newly created files to have their group set to the directory's group setting and not the default group for the user (usually their username).

share|improve this answer
add comment

Your Answer


