Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have Oracle Linux 5 installed on virtual machine. There is a shared folder created with samba. I can access this folder from my Windows 7 machine and copy files. My problem is, when i copy files to this folder, Group Access permissions changes to None, but I need Access: Read and write (for autodeploying on Weblogic).

Samba user:linux, machine user(login):linux, group:linux

smb.conf file:

[autodeploy]
path = /home/linux/Oracle/Middleware/user_projects/domains/base_domain/autodeploy
writeable = yes
browseable = yes
valid users = linux
force user = linux
force group = linux

Tried to use various chmod and chown commands, but nothing helped. I think prombel is in samba user, but I did't found how to modify samba user group (I'm not sure if it's possible).

share|improve this question
    
Did you try sudo chgrp linux smb.conf ? –  Neil Neyman Sep 22 '13 at 17:09
    
@Neil Neyman, nope, same result, Permissions-None –  Rinat Sep 22 '13 at 17:25
    
That's all I had sorry ! samba.org/samba/docs/man/Samba-HOWTO-Collection/… –  Neil Neyman Sep 22 '13 at 18:20

1 Answer 1

up vote 0 down vote accepted

From the this page:


.... However, if you're creating a shared directory for group access, you need to perform a few more steps. Let's take a stab at a group share for the accounting department in the smb.conf file:

 [accounting]
    comment = Accounting Department Directory
    writable = yes
    valid users = @account
    path = /home/samba/accounting
    create mode = 0660
    directory mode = 0770

The first thing we did differently is to specify @account as the valid user instead of one or more individual usernames. This is shorthand for saying that the valid users are represented by the Unix group account. These users will need to be added to the group entry account in the system group file ( /etc/group or equivalent) to be recognized as part of the group. Once they are, Samba will recognize those users as valid users for the share.

In addition, you need to create a shared directory that the members of the group can access and point to it with the path configuration option. Here are the Unix commands that create the shared directory for the accounting department (assuming /home/samba already exists):

# mkdir /home/samba/accounting
# chgrp account /home/samba/accounting
# chmod 770 /home/samba/accounting

There are two other options in this smb.conf example, both of which we saw in the previous chapter. These options are create mode and directory mode. These options set the maximum file and directory permissions that a new file or directory can have. In this case, we have denied all world access to the contents of this share. (This is reinforced by the chmod command, shown earlier.)


So at least you'll need to change valid users = @linux and add

    create mode = 0660
    directory mode = 0770

Edit: Above gives the user the ability to create files with these permission (maximum creation rights). It does not force them. So if this does not work you could try adding:

force create mode = 0660
force directory mode = 0770
force user = linux
force group = linux

If that still does not work you could try setting inherit permissions = yes and setting the parent directory manually once on 770.

On this page is some more information about assigning forced rights.

share|improve this answer
    
Thanks for answer @Rik, much better, however group permissions is now set to "no read, write". Tried to set different create mode, but nothing. Can't get "Read and write" permissions. Maybe I miss something... –  Rinat Sep 23 '13 at 5:56
    
I added some information to my answer about forcing create mode. The normal create mode only gives the ability to create files with this maximum permission. It does not force the client to set it to this maximum. Force create mode does. –  Rik Sep 23 '13 at 8:07
    
Finally I did it, thank you very much @Rik! –  Rinat Sep 23 '13 at 11:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.