You are not logged in.

#1 2014-06-10 22:24:08

Andy_Crowd
Member
From: 延雪平縣 Sweden
Registered: 2013-12-28
Posts: 119

[SOLVED]change default access creation rights for the users

Hi!

When a user creating folders or files it will allow full access to all users who are in the same group.
How can I make the changes to be default instead of using chmod always?

Last edited by Andy_Crowd (2014-06-11 14:47:29)


Help to make Arora bug free!!
日不落 | Year 2081 | 笑傲江湖 | One more a really good book in my collection the Drystoll.

Offline

#2 2014-06-10 22:49:10

rune0077
Member
Registered: 2009-04-11
Posts: 135

Re: [SOLVED]change default access creation rights for the users

You'd probably have to use ACL: https://wiki.archlinux.org/index.php/ACL

Offline

#3 2014-06-10 22:53:09

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED]change default access creation rights for the users

Offline

#4 2014-06-11 02:07:33

Andy_Crowd
Member
From: 延雪平縣 Sweden
Registered: 2013-12-28
Posts: 119

Re: [SOLVED]change default access creation rights for the users

I am using samba for shares and mask=0000
When I create a folder from remote PC then with local user(within same group but different username) I cannot create a new inside it and setfacls doesn't help. I can use and remove created but only one of the users can create.

Last edited by Andy_Crowd (2014-06-11 02:27:22)


Help to make Arora bug free!!
日不落 | Year 2081 | 笑傲江湖 | One more a really good book in my collection the Drystoll.

Offline

#5 2014-06-11 10:02:46

rune0077
Member
Registered: 2009-04-11
Posts: 135

Re: [SOLVED]change default access creation rights for the users

Under the share configurations in samba, you need to set the "create mask" value, which will determine the permissions of any file created in that share.

Default is 0755, which would mean only the user have write permission. Try to change this to 0775

Offline

#6 2014-06-11 11:00:34

Andy_Crowd
Member
From: 延雪平縣 Sweden
Registered: 2013-12-28
Posts: 119

Re: [SOLVED]change default access creation rights for the users

Here is an example with some entries from my smb.conf

security = share
guest account = windowstools

[WT]
path = /home/Windows/Win-tools
public = yes
writeable = yes
create mask = 0000
guest ok = yes
browseable = yes
read only = no

Windows XP is connected to my Linux share. I want be able to create folders and have access within Linux and Windows with rwx rights for the group. For now files created from Windows getting default rights 755 (rwx,xr,xr).

windowstools:andy = is XP username/group
andy:andy = Arch Linux username/group

Windows XP is full updated (got problem once with connection to samba after update, got wait until next updates will come -.- , when new windows updates came XP could be connected to samba again, was a bug as I hoped).

I am starting/restarting samba with script like

#!/bin/bash
systemctl stop smbd
sleep 2
systemctl status smbd | head -1
systemctl status smbd | grep 'Active:' | awk -F')' '{print $1}'  | sed 's/(//m'

systemctl stop nmbd
sleep 1
systemctl status nmbd | head -1
systemctl status nmbd | grep 'Active:' | awk -F')' '{print $1}' | sed 's/(//m'

systemctl start smbd
sleep 2
systemctl status smbd | head -1
systemctl status smbd | grep 'Active:' | awk -F')' '{print $1}'  | sed 's/(//m'

systemctl start nmbd
sleep 1
systemctl status nmbd | head -1
systemctl status nmbd | grep 'Active:' | awk -F')' '{print $1}'  | sed 's/(//m'

and not automatically on boot.

Windows XP is running in VMware Player on the same PC with Arch Linux.

Last edited by Andy_Crowd (2014-06-11 12:42:52)


Help to make Arora bug free!!
日不落 | Year 2081 | 笑傲江湖 | One more a really good book in my collection the Drystoll.

Offline

#7 2014-06-11 11:15:58

rune0077
Member
Registered: 2009-04-11
Posts: 135

Re: [SOLVED]change default access creation rights for the users

Okay. Samba also has a force create mask and a force directory mask you can set to force permissions on newly created files/directories: http://www.samba.org/samba/docs/man/man … CREATEMODE

Offline

#8 2014-06-11 13:25:41

Andy_Crowd
Member
From: 延雪平縣 Sweden
Registered: 2013-12-28
Posts: 119

Re: [SOLVED]change default access creation rights for the users

It doesn't work either

[WT]
path = /home/Windows/Win-tools
public = yes
writeable = yes
force create mode = 0000
force directory mode = 000
create mask = 0000
guest ok = yes
browseable = yes
read only = no

It still uses defaults on creation...


Help to make Arora bug free!!
日不落 | Year 2081 | 笑傲江湖 | One more a really good book in my collection the Drystoll.

Offline

#9 2014-06-11 13:49:00

rune0077
Member
Registered: 2009-04-11
Posts: 135

Re: [SOLVED]change default access creation rights for the users

I think (but am not certain), that force create mode is not a mask. So you should set them to 0775 (or whatever you need) and these are the permissions files/directories will be created with.

Offline

#10 2014-06-11 14:47:05

Andy_Crowd
Member
From: 延雪平縣 Sweden
Registered: 2013-12-28
Posts: 119

Re: [SOLVED]change default access creation rights for the users

Ok, Thank you. I didn't read careful enough about force mode but now it's working

Here is all steps I did:

sudo setfacl -Rm "g:andy:rwx" *
sudo setfacl -Rm "u:windowstools:rwx" *

smb.conf - options for the shared folder

[WT]
path = /home/Windows/Win-tools
public = yes
writeable = yes
### changed from 0000 to :
force create mode = 0776
### changed from 0000 to :
force directory mode = 0776
create mask = 0000
guest ok = yes
browseable = yes
read only = no

Last edited by Andy_Crowd (2014-06-11 15:08:34)


Help to make Arora bug free!!
日不落 | Year 2081 | 笑傲江湖 | One more a really good book in my collection the Drystoll.

Offline

Board footer

Powered by FluxBB