LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-26-2012, 10:28 AM   #1
joaquin.65
LQ Newbie
 
Registered: Jun 2012
Posts: 6

Rep: Reputation: Disabled
Samba changes file ownership


Hi!
Yeah, I know this subject has already been touched.

This is my problem.
I have some .xls files (MS Excel) and I need certain permissions in order to get the business working.
for example:
Code:
root@server:~# ls -l
-rwxrwxr-x 1 netadm admin2 285696 jun 26 12:06 REG-01.xls
So, when I need a user to have rw permission I add him/her to the group admin2.

But when any user modifies the file it changes the ownership, and permissions.
For example:
Code:
root@server:~# ls -l
-rwxrw-rw- 1 damnuser damnuser 285696 jun 26 12:14 REG-01.xls
I know that this is because MS Office programs create a different file, and then rename it to the original name in the process of saving a modified file.
But that screws all of my permissions!

I would need a way to force set certain permissions and ownership to new files.
Is that possible?

I found this other post, but couldn't get my concept to work.
http://www.linuxquestions.org/questi...-saved-800859/

I need some help, seriously. I dont have lots of knowledge of the subject, and I'm supposed to get this server up and working.
Thanks in advance!
Joaquín.

Last edited by joaquin.65; 06-26-2012 at 10:31 AM.
 
Old 06-27-2012, 03:59 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
probably you also need force group = admin2
I hope this helps
 
Old 07-02-2012, 11:56 AM   #3
joaquin.65
LQ Newbie
 
Registered: Jun 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
I SOLVED IT!

Im posting this just in case someone else gets here with the same problem.

What did I do?

First, I open the samba configuration file
Code:
nano /etc/samba/smb.conf
Then I go to the ===== Share Definitions ===== part and add the following at the bottom of the share you want to affect:

Code:
create mask = 0755
force create mode = 0775
force group = admin2
This permissions are for my personal use, you may need others.
The same happens with the group "admin2", you probably will need other group.

If you need different folders to have different user creation and permission settings, you should create a new share for each of those folders, that way you can configure them separately.

Hope it helps.
Bye!
 
  


Reply



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
RedHat Samba file ownership issues sharing with Windows users JayNic Linux - Newbie 3 12-04-2011 08:09 PM
[SOLVED] Samba changes file ownership when a file is saved StupidNewbie Linux - Security 2 04-09-2010 08:56 AM
Keeping file ownership in Samba dheemaz Linux - Server 1 11-19-2007 06:54 AM
Apache/Samba file permissions/ownership seedsca Linux - Networking 0 03-28-2004 09:07 PM
Samba changes file ownership hansen Linux - Networking 4 12-01-2003 12:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:19 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