LinuxQuestions.org
Visit Jeremy's Blog.
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 03-03-2010, 11:52 AM   #1
gagou7
LQ Newbie
 
Registered: Sep 2009
Distribution: Ubuntu 9.04 / Debian 5.0 / Backtrack 3
Posts: 27

Rep: Reputation: 0
Access rights: allow create but not delete and modify


Hi,

On my Debian server I installed Samba for sharing directories in my local network. I know how to set access rights but I have a problem. I would like to allow an user (example "nobody") to create files or directories in a shared directory but to deny to modify or delete something.

How can I do that?


Second question, on a file, I know that we can set rights for "u", "g" and "o". But like the NTFS permissions, can we apply rights for each users?


Thank's a lot for your response.
 
Old 03-03-2010, 11:55 AM   #2
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713Reputation: 713
NTFS does not support permissions.

And if "nobody" creates a file, do you want "nobody" to be able to delete the file he created?
 
Old 03-03-2010, 01:34 PM   #3
sunnydrake
Member
 
Registered: Jul 2009
Location: Kiev,Ukraine
Distribution: Ubuntu,Slax,RedHat
Posts: 288
Blog Entries: 1

Rep: Reputation: 41
1 - Basic ) change All files/dir in SHARED(o+rw/different user) folder to o+r-wx/different user. nobody can create files/dirs and delete them but can not delete all other files/dirs in this directory.
1 - Dynamic)I see a good way to upload to folder with o+rwx and after some time (based on cron job) change user/permissions on dir/files in it to u+rwx,g+rwx,o+r-xw/different user(or move to dir that have read-only access from net)
this way uploaded files (lets say in 12h time) can be changed but after 12h will only be accessed for read. This way you can mix old read-only files and newly uploaded.
x)i also saw somewhere(smb.conf?) option to create files with default mask (umask analogue)
x) there is umask command that change new files default permissions(it may work if you spawn samba as separate shell script). umask o+r-wx, echo >newfile, newfile (o+r-wx)
 
Old 06-21-2010, 06:42 AM   #4
gagou7
LQ Newbie
 
Registered: Sep 2009
Distribution: Ubuntu 9.04 / Debian 5.0 / Backtrack 3
Posts: 27

Original Poster
Rep: Reputation: 0
Ok, thank's. With umask I can do what I want.

Quote:
Originally Posted by MTK358 View Post
NTFS does not support permissions.

And if "nobody" creates a file, do you want "nobody" to be able to delete the file he created?
But on windows, on NTFS formated hard disk, you can set access right for each user. My question is: Can we do the same thing on Linux? Because normally "u" is for the owner, the "g" for the groupe and "o" for others.

All I ask is bound. Because I make a Samba share on a folder containing many files. The shared folder contain a website with video file and the owner of each file is "www-data" and his group "www-data". But I want to share this folder with Samba. I would like to add a user in the rights of video files for him to see. The file. Html,. Php. Css, ... must be invisible to the user.

How can I do that?

Thank's !!!
 
  


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
No access rights to delete or move files after re-install and moving from user folder sonicboy Ubuntu 5 01-18-2010 03:28 AM
Sharing read/write/create/delete rights DarkFlame Linux - Server 8 12-04-2008 09:42 AM
Delete or modify /dev nodes? PatM Linux - Newbie 2 04-19-2008 12:55 PM
cannot delete or modify the file k0nsole.c Linux - General 7 06-25-2007 09:07 PM
modify file access & modify timestamps i2itstud Linux - General 1 05-20-2003 03:34 AM


All times are GMT -5. The time now is 12:30 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration