• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 302
  • Last Modified:

Fedora / Samba - n00b - how to give these two users write access to files the other creates in the "management" share?

If they originate the files they can read / write - but if they try to edit others docs they can only read.

What to do?


[ed@server1 users folders]$ su root
Password:
[root@server1 users folders]# mkdir management
[root@server1 users folders]# ls
admin-private  admin-public  management  test  users-personal
[root@server1 users folders]# chmod 777 management
[root@server1 users folders]# ls
admin-private  admin-public  management  test  users-personal
[root@server1 users folders]# service smb restart
Shutting down SMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]
[root@server1 users folders]# cd management
[root@server1 management]# ls
clarewil.txt  tommyd.txt
[root@server1 management]# ls la
ls: cannot access la: No such file or directory
[root@server1 management]# ls -la
total 8
drwxrwxrwx  2 root     root   4096 Apr  4 15:34 .
drwxrwxrwx. 7 root     root   4096 Apr  4 15:31 ..
-rwxr--r--  1 clarewil public    0 Apr  4 15:33 clarewil.txt
-rwxr--r--  1 tommyd   public    0 Apr  4 15:34 tommyd.txt
[root@server1 management]#



0
fcek
Asked:
fcek
  • 4
  • 3
3 Solutions
 
upanwarCommented:
You can add those two user in a group, in which other users belong and give your share to write permission to the group and add this line in your smb.conf for that perticular share.

create mask = 0775

It will create files with permission 775 and your users and users belongs to that group would be able to edit that files.
0
 
fcekAuthor Commented:

smb.conf

Before:

[management]
      path = /users folders/management
      valid users = clarewil, ed, tommyd
      read only = No
      browseable = No

After:

[management]
      path = /users folders/management
      valid users = clarewil, ed, tommyd
      read only = No
      browseable = No
      create mask = 0775


============================ result is worse! ====================

[ed@server1 management]$ touch ed.txt
[ed@server1 management]$ ls
clarewil.txt  ed.txt  tommyd.txt
[ed@server1 management]$ ls -la
total 8
drwxrwxrwx  2 root     root   4096 Apr  4 22:57 .
drwxrwxrwx. 7 root     root   4096 Apr  4 15:31 ..
-rwxr--r--  1 clarewil public    0 Apr  4 15:33 clarewil.txt
-rw-r--r--  1 ed       public    0 Apr  4 22:57 ed.txt
-rwxr--r--  1 tommyd   public    0 Apr  4 15:34 tommyd.txt
[ed@server1 management]$

===================================================

Do I create a "group" and add the three people to it?
FYI - I already have a group called "public" and everyone is a member of it.
0
 
upanwarCommented:
If a group named public is available and do you want that all users belongs to public group can modify that files or only the three user can modify.

If for three users only then you need to create a different group otherwise not.

You are asking asking here about samba and creating files locally. The suggestion which I have given will work for samba only. If you need a solution for the files which you creates locally then we have to go for different solution.

Please clarify whether you need the solution for samba only or your requirement is different.
0
Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

 
upanwarCommented:
For samba share the above solution will work and if you want that locally when these three user creates a file it should have permission of 775 then you need to change the umask for these three users.

go to in each user's home directory and append/modify following line in that user's .bashrc file.

# vi .bashrc

umask 002

Now every created file by those three users will have permission of 775.
0
 
fcekAuthor Commented:

Hi upanwar.  To explain this better.

Share "Public"
Group "public" - Everyone is a member of it.  It works fine.

New share: Management.
I want three people to have full access but everyone else not to be able to see it.

Do I have to create a group called "management" and put @management in samba so all have equal rights to read/write/execute?


0
 
upanwarCommented:
yes thats correct and your three users should belongs to new group.
0
 
fcekAuthor Commented:


Sounds logical and doesnt sound too difficult.  Will give it a try tonight in the early hours after my day work is done.


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now