LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   setting samba read/write permissions for seperate users (https://www.linuxquestions.org/questions/linux-networking-3/setting-samba-read-write-permissions-for-seperate-users-489682/)

phildacey 10-05-2006 09:15 AM

setting samba read/write permissions for seperate users
 
Hello all,

I'm having trouble finding out how to share folders with specific access permissions for each user so I thought I'd ask. I'm using samba and this is the set up:

[Ubuntu box] - should be able to read/write to all folders shared on [server box]

[Xp Box] - should be able to read/write to all folders shared on [server box]

[xp Box2] - should have read only access to all folders shared on [server box]

[xp Box3] - should have read only access to all folders shared on [server box]

[xp Box4] - should have read only access to all folders shared on [server box]

Eventually, I'll get round to sharing the home directories on all machines but at the moment I just want to achieve the above. Thanks in advance : )

TylerD75 10-05-2006 11:02 AM

If you've got unique user names on each computer:
Let's say you have these users: ubox, box1, box2, box3, box4?
1. I'll assume you've added these users to both the ubuntu users and the samba users.
2. You might want to add these users to a group called ex. shareusers, then change group on all shares to this group name.
3. Now you change owner of all shares to ubox, and set his access rights to read and write: chmod -R 0644 <sharename>.
The above command will also set the groups access rights to read, and everyone else to read.

You could also do the same without adding all users to the group you created, but then you need to use force group = shareusers, which will in effect cause all logons to use the group shareusers. This has to be added to each of the share definitions in smb.conf.

As you can see by this, the samba share rights are handled exactly the same way as access rights locally on any linux system.
This is the reason you have to create a linux user (or an alias) for each samba user. So that linux knows what user the network access is operating as.

Hope this helps?

phildacey 11-06-2006 01:23 PM

thanks
 
Thanks Tyler, great advice. I'm all sorted now : )

TylerD75 11-07-2006 04:09 AM

Good to hear!


All times are GMT -5. The time now is 04:29 PM.