LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-02-2006, 06:02 AM   #1
bence8810
Member
 
Registered: Nov 2004
Location: Budapest, Hungary
Distribution: Debian
Posts: 110

Rep: Reputation: 15
Samba - Inherit Permissions from Parent Directory


Hi,

I have a small home-server running Debian, and I store all films, music and other files on it. My wife and I access it only, and a couple of friends from the outside through FTP and SSH.

I set up Samba for file sharing, and I would like to set it up with Inheritable permissions. Lets say, there is a Directory called Films. I get a new film, and I want to copy it to the Samba share from my laptop, but it will have a unique permission, and not what the folder I copy it into has. I got as far as the Group is inherited from the folders above, but I still have to chmod the copied file to remove access for Other users. Maybe umask can do it? I am looking for any possible solutions.

Thanks,

Ben
 
Old 08-02-2006, 07:43 AM   #2
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,465
Blog Entries: 1

Rep: Reputation: 66
In the share's samba section add:
Code:
create mask = 0774
directory mask = 0775
Any NEW created files on this directory would be 0774 and NEW directories 0775. For the older files and dirs, you need to fix it yourself with the command chmod.
 
Old 08-02-2006, 07:54 AM   #3
bence8810
Member
 
Registered: Nov 2004
Location: Budapest, Hungary
Distribution: Debian
Posts: 110

Original Poster
Rep: Reputation: 15
Hi

Thanks. I will try that.

So when I copy some file from my Windows Laptop to the Shared folder, what permission will it get? As far as Samba goes, that is a newly created file, right?

Ben
 
Old 08-02-2006, 08:05 AM   #4
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,465
Blog Entries: 1

Rep: Reputation: 66
The new file will get the octal permission you specify in the above statments. It will be -rwxrwxr-- for files and drwxrwxr-x for directories.

This permission will give to all members that are in the same group you are the rights to read and write to the file. Others, (the people is not in the same group you are) will give only read access.

For directories, it will give rights to read and create new files in that directory. Others, can only read the contents, not create new files.

This is a good setup for your family. Put you and your wife in the same group, and your kids in another group. That way, they won't mess up the things, but still have full read access.

You can even setup a second share with more restrictive permissions for others. In that way, the kids won't have any access at all to this sensitive share.
 
Old 08-03-2006, 03:14 AM   #5
bence8810
Member
 
Registered: Nov 2004
Location: Budapest, Hungary
Distribution: Debian
Posts: 110

Original Poster
Rep: Reputation: 15
Hi

I went home and set everything up, and it works like a charm, thanks. Its getting the permissions set in the smb.conf when I transfer a file from the Windows environment to the Share. Great.

I also set the setgid for the Directory, so all directrories created within will have the same Group permission.

Cheers

Ben
 
Old 08-03-2006, 06:17 AM   #6
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,465
Blog Entries: 1

Rep: Reputation: 66
Just in your last post I realize you are in Hungary !

Well, all my grand-parents come from Hungary. They went to Brazil in late 20's and they live in a Hungary neighborhood here for several years. I don't know how to speak Hungary, just a few words I remember from my grand-mother a few dirt words I learned from my dad

My mother's maiden name is Mezaros (there is one or two accents somewhere). We still have some relatives there, I am sure.

I am sorry if I am bothering you with this, but is nice to know people from were my family comes from.

have a nice day !

Last edited by marozsas; 08-04-2006 at 09:54 AM.
 
Old 08-03-2006, 06:33 AM   #7
bence8810
Member
 
Registered: Nov 2004
Location: Budapest, Hungary
Distribution: Debian
Posts: 110

Original Poster
Rep: Reputation: 15
Hi

That is quite interesting, I didnt know Hungarians ever immigrated to Brazil. So I take it your Grand parents' last name would be Mészáros , provided that this forum takes accents. This last name means Butcher, or something similar in old terms.

Well, thanks for helping again, and hope you get to visit Hungary one day. If you can though, make sure you come in Summertime. I am sure a Brazilian would suffer in our cold winter

Cheers

Ben
 
  


Reply


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
Samba directory permissions - can't write from XP ajkrishock Linux - Networking 2 10-16-2005 12:56 PM
samba file/directory permissions jonfa Linux - Networking 2 06-29-2005 08:03 AM
How to make a file inherit script permissions antony.booth Linux - Security 4 03-11-2005 05:04 AM
Samba Won't Inherit Permissions blackrain69 Linux - Software 1 10-13-2004 01:46 AM
Inherit Permissions in Samba mslane Linux - Software 1 10-09-2003 05:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:03 AM.

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