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 03-24-2010, 06:29 PM   #1
adrian2009
Member
 
Registered: May 2009
Posts: 40

Rep: Reputation: 15
Forbid user from opening a file


If there's some file, how can i forbid user to open it ? Ex. some text file or video file and forbid regular users (except root) to open/play it .
Wouldn't chmod work here or should i use some other method ?
 
Old 03-24-2010, 06:37 PM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,606

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Quote:
Originally Posted by adrian2009 View Post
If there's some file, how can i forbid user to open it ? Ex. some text file or video file and forbid regular users (except root) to open/play it .
Wouldn't chmod work here or should i use some other method ?
Code:
chmod 600 /path/to/file
should work. Now only the owner should be able to open that file.
 
Old 03-24-2010, 07:18 PM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2beta3 on Lenovo Thinkpad W520
Posts: 6,789

Rep: Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135
In addition, make sure that this file be owned by root:
Code:
chown root:root /path/to/file
 
  


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
smpatch issue (forbid from update) routers Solaris / OpenSolaris 4 07-31-2009 01:41 PM
Long file names on Linux file server jumbled when opening on 16-bit PC program. brandonhughesj General 3 03-04-2009 08:53 AM
Xp user opens file via Samba, but file is not locked after opening??? marisdembovskis Linux - Networking 8 07-04-2006 04:30 AM
how to forbid apt-get .deb removing coco03 Linux - Software 1 03-29-2006 02:35 AM
opens pico but aint opening file user specifys? twirl Programming 66 09-14-2005 12:01 PM


All times are GMT -5. The time now is 09:49 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration