LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-18-2014, 01:05 PM   #1
nadic
LQ Newbie
 
Registered: Jun 2013
Posts: 9

Rep: Reputation: Disabled
Permission to files under directory


Hi,

I have directory with permissions
Code:
drwxrwsr-x.  4 nadic serverusers
When I connect with samba as another user and that user creates some file, I don't have access to this file. Is there any way to set some settings and have permissions?
Both users (nadic and that remote) are in group 'serverusers'.
 
Old 01-18-2014, 02:55 PM   #2
WarTurkey
Member
 
Registered: Jun 2009
Posts: 67

Rep: Reputation: 16
When you connect with Samba, are you connecting using a Linux client or a Windows client? And when you don't have access, do you mean you specifically get an "Access denied" error, or some other error/no message?
 
Old 01-19-2014, 04:06 AM   #3
nadic
LQ Newbie
 
Registered: Jun 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
I'm connecting with Mac OS (it's my main goal), but I also tried with Android. I don't get any message, I can connect and see or copy files, but I can't edit them in Samba shared directory. File created by another user has such permissions
Code:
-rwxr--r--. 1 nata   serverusers    0 01-19 11:04 test
 
Old 01-19-2014, 04:49 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
@nadic: The current permissions seem to be:

- owner -> rwx (read, write, execute)
- group -> r (read)
- others -> r (read)

If you are not the owner (nata in your second example) you only have read permissions. If you want to give the group serverusers write access you need to change the default permissions that are being used.

Maybe this link will help: Samba share permissions simplified
 
Old 01-19-2014, 07:44 AM   #5
nadic
LQ Newbie
 
Registered: Jun 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Useful link. Thanks.

I set
Code:
	writeable = yes
	create mask = 0775
File permissions are now:
Code:
-rwxrw-r--. 1 nata   serverusers    0 01-19 14:31 test2
I belong to serverusers group:
Code:
nadic@localhost ~$ groups nadic 
nadic : nadic wheel vboxusers serverusers
Looks like group has write permission, but I still can't edit files created by nata (remote) user.
 
Old 01-19-2014, 09:26 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
All seems to be in order:

1 - Parent directory has 2775 permissions (forcing serverusers as group),
2 - File has correct permissions (r+w for group serverusers),
3 - User nadic is member of the serverusers group,
4 - Share is writeable.

Only two things come to mind:
- Did you restart samba and re-mount the share after making changes?
- I see a dot in the ls output (-rwxrw-r--. 1 nata ...), which means SELinux might be involved. My SELinux knowledge is too limited to be able to help you with that (I'm not even sure it is involved....).
 
Old 01-19-2014, 10:37 AM   #7
nadic
LQ Newbie
 
Registered: Jun 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thank you for itemize it.
-Yes, I restarted samba and remounted the share.
-I used SELinux settings as it is described in smb.conf and also enabled:
Code:
sudo firewall-cmd --add-service=samba-client
sudo firewall-cmd --add-service=samba
But now I restarted my system and it works!

Thank you very much.

Now I have opposite problem. When I create file in shared directory, it belongs to 'serverusers' group, but group has only r-- permission. And now I don't know how to configure it that others could edit my files also. In samba I have also line:
Code:
read only = no
, so it probably requires some Linux config.

EDIT: I see that I should somehow set 'umask 2' for that folder. Now I try to figure out how to do it.

Last edited by nadic; 01-19-2014 at 10:47 AM.
 
  


Reply

Tags
permissions, samba permissions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Default permission on files/directory wegadnie Linux - Newbie 5 11-20-2008 03:27 AM
"Permission denied" and "recursive directory loop" when searching for string in files mack1e Linux - Newbie 5 06-12-2008 07:38 AM
Permission problem with files under a directory orbish Linux - Newbie 2 08-11-2006 04:58 AM
Changing File Permission in a FTP directory to prevent deleting of files shawnbishop Linux - Software 3 01-10-2006 05:41 AM
how to change exisitng files/directory permission from 755 to 770 mweil Linux - Newbie 3 07-01-2004 10:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration