configure smb.conf for set permission file and folder
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
configure smb.conf for set permission file and folder
Hi all, need help please, can i know how to set/rule the permission file and directory on smb.conf so everytime user create/save file the permission not use default from samba 744, i had try several ways for this issue:
Code:
[DataSamba]
comment = Data Samba
path = /DataSamba
valid users = %S, %D%w%S
browseable = No
read only = Yes
inherit acls = Yes
[engineering]
comment = Data engineering
path = /DataSamba/engineering
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
create mask = 0770
force create mode = 0770
directory mask = 0770
force directory mode = 0770
for that part of my smb.conf that i want to configure but it's not work
on directory engineering that owner of that directory i set to user "eng02" and part group "Engineering" i also create one user for test out "eng01" which part group "Engineering", when first time i create folder engineering on path /DataSamba/engineering i change the ownership and permission to 770 cause every member group "Engineering" wants they can
create a new file, edit by their part of group, save it, create new folder, save file to that new folder by their members.
i also try to add force group but it's not work, and is there any major effect global setting on smb.conf for this issue ?
actually i only domain master and add machine script to global setting smb.conf.
You have "inherit acls" set to yes, which means that the default directory acls are propagated.... that can be the case...
Also you need to set SGID for the /DataSamba/engineering directory and change group membership to Engineering group, so if any of the users create a file in the directory, it will be marked with Engineering as the group, even though their primary group is different..
thanks for your reply cyprinidae, i had try to set inherit acl on path DataSamba and engineering to set No but not work at all and about change ownership and group at folder
engineering i had do that at first time create folder.
Can you explain to me about chmod g+s to directory engineering.
Hi billymayday, i try that on my suse but it shows invalid option, and
i had been checked man ls and not found options using "Z".
Could you tell me what exactly ls -Z function for ?
Following this Samba will bit-wise 'OR' the UNIX mode created from
this parameter with the value of the force create mode parameter
which is set to 000 by default.
Try "create mode 770" in place of "create mask 0770" and similarly for directory mask.
Thanks billymayday for your reply,
I had try to change like this:
Code:
create mode = 770
force create mode = 770
I changed that way on path engineering.
Still it not work, as i know create mask same as create mode.
Anyway how do you think about this http://forum.soft32.com/linux/Newbie...ict374307.html cause based on that i try to change that
create mask = 000 and just use force create mode = 0770
and still again it not work.
Need advise please, or there is something rule when first time create user
samba cause i just do :
useradd "username"(without password so in /etc/passwd nologin)
groupadd "groupname"
smbpasswd -a "username"(same like useradd)
And this is global setting on my smb.conf, i hope you can help me to check it out if something wrong cause i use this to on my home
Code:
[global]
workgroup = WORKGROUP
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
usershare allow guests = Yes
add machine script = /usr/sbin/ useradd -c Machine -d /var/lib/nobody -s /bin/false%m$
domain master = No
domain logons = No
security = user
passdb backend = smbpasswd
I had try setting that you gave to me billymayday and it's not work,
i really don't know what's goin on,
And for part dhcp.conf at my smb.conf i just forget to delete it from line.
When connect to samba the exactly thing is i always do search computer
from windows and put the ip address of samba pc and it connect
about log samba, honestly i just see log samba for those who connect to
samba, cause this is just new samba i never watch this log file(my stupidity).
when i see it it seems from date 19th January 2009 the first time i try this new pc to samba had some errors,
Code:
[2009/01/19 10:38:32, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/01/19 10:38:32, 1] lib/account_pol.c:account_policy_get(332)
account_policy_get: tdb_fetch_uint32 failed for field 1 (min password length), returning 0
[2009/01/19 10:38:32, 1] lib/account_pol.c:account_policy_get(332)
account_policy_get: tdb_fetch_uint32 failed for field 2 (password history), returning 0
[2009/01/19 10:38:32, 1] lib/account_pol.c:account_policy_get(332)
account_policy_get: tdb_fetch_uint32 failed for field 3 (user must logon to change password), returning 0
[2009/01/19 10:38:32, 1] lib/account_pol.c:account_policy_get(332)
account_policy_get: tdb_fetch_uint32 failed for field 4 (maximum password age), returning 0
[2009/01/19 10:38:32, 1] lib/account_pol.c:account_policy_get(332)
account_policy_get: tdb_fetch_uint32 failed for field 5 (minimum password age), returning 0
[2009/01/19 10:38:32, 1] lib/account_pol.c:account_policy_get(332)
account_policy_get: tdb_fetch_uint32 failed for field 6 (lockout duration), returning 0
[2009/01/19 10:38:32, 1] lib/account_pol.c:account_policy_get(332)
account_policy_get: tdb_fetch_uint32 failed for field 7 (reset count minutes), returning 0
[2009/01/19 10:38:32, 1] lib/account_pol.c:account_policy_get(332)
account_policy_get: tdb_fetch_uint32 failed for field 8 (bad lockout attempt), returning 0
[2009/01/19 10:38:32, 1] lib/account_pol.c:account_policy_get(332)
account_policy_get: tdb_fetch_uint32 failed for field 9 (disconnect time), returning 0
[2009/01/19 10:38:32, 1] lib/account_pol.c:account_policy_get(332)
account_policy_get: tdb_fetch_uint32 failed for field 10 (refuse machine password change), returning 0
[2009/01/19 10:52:59, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/01/19 10:59:34, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/01/19 11:01:19, 1] smbd/service.c:make_connection_snum(950)
pc-test (10.1.0.3) connect to service users initially as user eng04 (uid=1002, gid=1000) (pid 18007)
[2009/04/14 09:30:07, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/14 09:30:18, 0] passdb/pdb_smbpasswd.c:build_sam_account(1202)
build_sam_account: smbpasswd database is corrupt! username toor with uid 1001 is not in unix passwd database!
[2009/04/14 09:30:37, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9300)
[2009/04/14 09:30:37, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 09:30:37, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9303)
[2009/04/14 09:37:24, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 09:37:32, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/14 09:37:49, 0] passdb/pdb_smbpasswd.c:build_sam_account(1202)
build_sam_account: smbpasswd database is corrupt! username toor with uid 1001 is not in unix passwd database!
[2009/04/14 09:37:56, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=100) (pid 9423)
[2009/04/14 09:37:56, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 09:37:56, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=100) (pid 9425)
[2009/04/14 09:43:23, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 09:43:24, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/14 09:43:25, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9538)
[2009/04/14 09:43:32, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 09:43:57, 0] passdb/pdb_smbpasswd.c:build_sam_account(1202)
build_sam_account: smbpasswd database is corrupt! username toor with uid 1001 is not in unix passwd database!
[2009/04/14 09:44:03, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9542)
[2009/04/14 09:44:03, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 09:44:03, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9545)
[2009/04/14 10:06:53, 0] lib/util_sock.c:read_data(534)
read_data: read failure for 4 bytes to client 10.1.0.66. Error = No route to host
[2009/04/14 10:06:53, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 10:38:22, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/14 10:39:08, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9676)
[2009/04/14 10:54:39, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 10:54:39, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/14 11:19:32, 0] passdb/pdb_smbpasswd.c:build_sam_account(1202)
build_sam_account: smbpasswd database is corrupt! username toor with uid 1001 is not in unix passwd database!
[2009/04/14 11:19:38, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9772)
[2009/04/14 11:19:38, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 11:19:38, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9775)
[2009/04/14 11:21:59, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 11:22:00, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/14 11:22:01, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9805)
[2009/04/14 11:22:05, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 11:22:29, 0] passdb/pdb_smbpasswd.c:build_sam_account(1202)
build_sam_account: smbpasswd database is corrupt! username toor with uid 1001 is not in unix passwd database!
[2009/04/14 11:22:34, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9809)
[2009/04/14 11:22:34, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 11:22:34, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9811)
[2009/04/14 11:24:03, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 11:24:03, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/14 11:24:04, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9841)
[2009/04/14 11:24:16, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 11:24:44, 0] passdb/pdb_smbpasswd.c:build_sam_account(1202)
build_sam_account: smbpasswd database is corrupt! username toor with uid 1001 is not in unix passwd database!
[2009/04/14 11:24:51, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9845)
[2009/04/14 11:24:51, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 11:24:51, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9848)
[2009/04/14 11:27:23, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 11:27:23, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/14 11:27:47, 0] passdb/pdb_smbpasswd.c:build_sam_account(1202)
build_sam_account: smbpasswd database is corrupt! username toor with uid 1001 is not in unix passwd database!
[2009/04/14 11:27:54, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9902)
[2009/04/14 11:27:54, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/14 11:27:54, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 9902)
[2009/04/14 11:31:35, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/15 09:59:27, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/15 10:00:09, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/15 10:01:17, 0] passdb/pdb_smbpasswd.c:build_sam_account(1202)
build_sam_account: smbpasswd database is corrupt! username toor with uid 1001 is not in unix passwd database!
[2009/04/15 10:01:35, 0] passdb/pdb_smbpasswd.c:build_sam_account(1202)
build_sam_account: smbpasswd database is corrupt! username toor with uid 1001 is not in unix passwd database!
[2009/04/15 10:01:42, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 5245)
[2009/04/15 10:01:42, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/15 10:01:42, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 5247)
[2009/04/15 10:05:13, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 5256)
[2009/04/15 10:09:06, 0] lib/util_sock.c:read_data(534)
read_data: read failure for 4 bytes to client 10.1.0.66. Error = Connection reset by peer
[2009/04/15 10:09:06, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/15 10:29:01, 0] lib/util_sock.c:read_data(534)
read_data: read failure for 4 bytes to client 10.1.0.66. Error = No route to host
[2009/04/15 10:29:01, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/15 10:44:07, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/15 10:45:46, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 5393)
[2009/04/15 11:09:51, 0] lib/util_sock.c:read_data(534)
read_data: read failure for 4 bytes to client 10.1.0.66. Error = No route to host
[2009/04/15 11:09:51, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/15 11:48:50, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 5847)
[2009/04/15 11:50:00, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/15 11:50:00, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/15 11:50:10, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 5879)
[2009/04/15 11:52:04, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/15 11:52:05, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/15 11:52:09, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 5911)
[2009/04/15 12:53:36, 0] lib/util_sock.c:read_data(534)
read_data: read failure for 4 bytes to client 10.1.0.66. Error = No route to host
[2009/04/15 12:53:36, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/16 14:11:34, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/16 14:12:07, 0] passdb/pdb_smbpasswd.c:build_sam_account(1202)
build_sam_account: smbpasswd database is corrupt! username toor with uid 1001 is not in unix passwd database!
[2009/04/16 14:12:12, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 4859)
[2009/04/16 14:12:12, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/16 14:12:12, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 4861)
[2009/04/16 14:17:14, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/16 14:17:14, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/16 14:17:27, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 5045)
[2009/04/16 14:19:32, 1] smbd/service.c:close_cnum(1150)
pc (10.1.0.66) closed connection to service users
[2009/04/16 14:19:33, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/16 14:19:41, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 5076)
[2009/04/16 14:42:58, 0] lib/util_sock.c:read_data(534)
read_data: read failure for 4 bytes to client 10.1.0.66. Error = No route to host
[2009/04/16 14:42:58, 0] lib/util_sock.c:write_data(562)
write_data: write failure in writing to client 10.1.0.66. Error Broken pipe
[2009/04/16 14:42:58, 0] lib/util_sock.c:send_smb(769)
Error writing 75 bytes to client. -1. (Broken pipe)
[2009/04/16 14:59:47, 0] smbd/server.c:main(847)
smbd version 3.0.23d-6-1083-SUSE-SL10.2 started.
Copyright Andrew Tridgell and the Samba Team 1992-2006
[2009/04/16 15:01:04, 1] smbd/service.c:make_connection_snum(950)
pc (10.1.0.66) connect to service users initially as user eng01 (uid=1001, gid=1000) (pid 5198)
well maybe i will try first your method at my home and if it success
i will inform you and i will try to reinstall this new pc and setup the samba from the beginning again.
Sorry for bothering you billymayday and i'm very appreciated your help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.