LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 10-27-2009, 08:53 PM   #16
lwasserm
Member
 
Registered: Mar 2008
Location: Baltimore Md
Distribution: ubuntu
Posts: 184

Rep: Reputation: 41

Quote:
Originally Posted by chrism01 View Post
Give it a try on a test file/dir. I suspect that the owner could (should be able to) change the perms.
You're right about the owner being able to change the permissions. But I'm almost positive I saw an example somewhere of using regular permissions and owner:group assignments to exclude a single user from accessing a particular file.

I tested something like my 1st example and found a combination that seems to work, see what you think.

Code:
$ ls -ld . # working directory owned by root:root
drwxr-xr-x 11 root root 4096 2009-10-27 21:28 .
$ # File is owned by root, group set to username to be excluded
$ # My regular name on system is lwasserm
$ ls -l TestFile # File permissions set to 707
-rwx---rwx 1 root lwasserm 13 2009-10-27 21:28 TestFile
$ cat TestFile
cat: TestFile: Permission denied
$ sudo cat TestFile
Hello World
$ rm TestFile
rm: remove write-protected regular file `TestFile'? y
rm: cannot remove `TestFile': Permission denied
$ chmod g+rw TestFile
chmod: changing permissions of `TestFile': Operation not permitted
$ rm TestFile
rm: remove write-protected regular file `TestFile'? y
rm: cannot remove `TestFile': Permission denied
$
 
  


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



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

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