Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
I have a problem with samba file and group share permissions.
The problem is as follows :
I have 10 users and 5 groups who all need to access the samba share
The root folder of samba has permissions for group A.
While the sub-folders have permission for other groups for each sub folder.
The problem i am facing is when some one writes from windows or even linux the permissions get changed to the particular user and some other groiup ..... so each time i need to keep changing the permissions .... is there any way in samba that can be configured so that the permissions remain intact even if some one creates a file or a folder ...
I have set those options but stilll have problems .......
I will try put my problem in detail
I have share named share_1.
It has sub-folders with names sub_1,sub_2,sub_3,sub_4
The users are user_1,user_2,user_3,user_4,user_5,user_6,user_7,user_8
users user_1,user_2 need to have r+w+x access to all the share and all the sub-folders.
while user_3,user_4 can have rwx access to only sub_2
user_5,user_6 for sub_3
user_4,user_7,user_8 for sub_4
user_1,user_2,user_8 for sub_1
though user_1 and user_2 can access all the folders with rwx
I have created each set as groups and added the reqd users with grp_1,grp_2,grp_3, and grp_4
everything turns out to be proper except when some one from the particular grp creates a new file/edit's a file the permission changes such that only he can do the modifications.
As well as the root directory of share_1 does not allow user_2 even though the permission is set to 775 for that folder.
my question is why is the permission changing and how can i rectify this.
Probably the only work around I know of is that you'll need to setup a separate shares thru samba for those to access the sub directories and then those users will see such shares, etc.
Can you tell me why the share root directory keeps changing the permission from 775 to 755 ? and how to fix that .... i did chmod but it changes back to 755 after sometime ..... i am confused
It was the msec that i needed to change the permissions in the perm.* file
Also for the samba share problem i just need to chmod with the group id so that the group permission remains intact
find path/to/share -type d print0 | xargs -0 chmod g+s
Explanation:
find = the find command, which finds files matching
criteria
/path/to/share = any directory where you want to apply
inheritence
-type d = Directories
-print0 = Print with no newlines, for xargs to read
| = run this command on the output
xargs = run a command on each line input
-0 = data comes in with no newlines
chmod = change mode
g+rwxs = read, write, execute (browse), and set group
id
Then you chgrp all files:
chgrp -R /path/to/share
Explanation:
chgrp = change group of the files/folders
-R = Recursive
Finally, add members to your group:
gpasswd -a <user> <group>
Explanation:
gpasswd = the group password command, but we're not
setting a password here
-a = Add
Have the users log out and back in again to take
effect.
>From then on, all files created in that directory will
be in the same group. The user doesn't truly matter,
as long as you have at least ---r-x--- for group
read-only directories, ---rwx--- for group writeable
directories, ---r----- for group readable files,
---rw---- for group writeable files. At least those
permissions. You could then safely remove "other"
permissions to prevent a breech in security, as
everyone should be in that group to have access.
This is also useful with Winbind and "winbind use
default domain = yes" in smb.conf. I can create a
group:
groupadd smbwrite
Add some users from my NT domain into it:
for USER in chris steve mike; do
gpasswd -a $USER smbwrite
done
Set my permissions:
find /share/mis -type d -print0 | xargs -0 chmod g+s
And then set the group ID:
chgrp -R smbwrite /share/mis
Also, sgid is the 2 bit in the first number of octal
permissions (e.g. chmod 2770 some_directory).
Don't forget to have your users log out before trying,
and good luck.
I shld thank google groups for this ...... I dont the name of the person otherwise i would have included his name here as well .... he deserves the credit for this
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.