LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices

Reply
 
Search this Thread
Old 05-18-2005, 07:33 PM   #1
UnforgotteN
LQ Newbie
 
Registered: May 2005
Posts: 16

Rep: Reputation: 0
Question about permissions


I own a linux server centos 3.4.

I have some files that i allow friends access to, but some files i dont want them to be able to modify.

My question is, How do i set permissions on some files so that some files can be owned and only rewrite by root, and some can be owned and rewrite by root and also users (my friends).

John,
Thanks!
 
Old 05-18-2005, 07:43 PM   #2
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
man chmod, man chown

Essentially, you'll have to run chown root <somefile> followed by the appropriate chmod command.

Cheers,

mj
 
Old 05-18-2005, 07:54 PM   #3
UnforgotteN
LQ Newbie
 
Registered: May 2005
Posts: 16

Original Poster
Rep: Reputation: 0
Im sorry, im totally new using linux.

what would be the appropiate command to only allow me (root) have total control of that file, i mean still let my freinds see it but other than that everything.

what are the commands for chmod? also is that done in one single code like

chown root <somefile> chmod <command>

or in 2

chown root <somefile>
chmod<command>

Thanks Alot for answearing bud!

Last edited by UnforgotteN; 05-18-2005 at 07:56 PM.
 
Old 05-18-2005, 08:14 PM   #4
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
What do you mean by 'total control' ? Root has this by definition.

Permissions are usually either read, write, or execute. Thus, assuming you want root to be the only one to be able to read & write to a file that he/she doesn't yet own, then
Code:
chown root <somefile>
chmod -v 0600 <somefile>
Chmod and chown are two separate commands, however both can accept wildcards, redirects and so on, so you could readily do for f in *.tex; do chmod 0600 $f; done, or chmod -v 0600 *.eps.

mj
 
Old 05-18-2005, 08:21 PM   #5
UnforgotteN
LQ Newbie
 
Registered: May 2005
Posts: 16

Original Poster
Rep: Reputation: 0
so -v 0600 is the command so that the file can be write and read only by the person who we set the chown command to?

what if i want the user to read the file but not to write it, then what chmod command do we use?

"however both can accept wildcards, redirects and so on, so you could readily do for f in *.tex; do chmod 0600 $f; done, or chmod -v 0600 *.eps."

I don't understand that... what do you mean bud, I'm starting to learn so there is a lot of stuff i still cant understand, please explain that with more details bud.
 
Old 05-18-2005, 08:32 PM   #6
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
No, 0600 is the octal representation of the permissions to be set -- in this case, read/write for the owner (in this case root), permissions denied for all other users. This could also be done in character mode, for example chmod -v u=rw <somefile> && chmod -v go-rwx. If you run these commands, and have a read of the manual page (type man chmod into a terminal) you will see what is happening. "u" stands for the current user/owner of the file, "g" the group members of the file, "o" others", and "a" all users.

Alternatively, you can also change file permissions using most graphical file browsers -- for example on the permissions tab in KDE's Konqueror.

The most useful thing to do, honestly, is to a) READ READ READ, and b) play around with your system as much as possible.

Cheers,

mj
 
Old 05-18-2005, 08:51 PM   #7
UnforgotteN
LQ Newbie
 
Registered: May 2005
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks alot bud!
 
  


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
Another permissions question BajaNick Linux - Software 2 01-21-2004 11:40 AM
Permissions Question dragin33 *BSD 1 01-05-2004 06:35 PM
Permissions question sammckee Linux - Newbie 3 09-23-2003 10:55 AM
Permissions question... phil1076 Linux - General 3 09-03-2003 10:50 AM
Permissions Question? gsmonk Linux - General 3 08-27-2003 03:30 PM


All times are GMT -5. The time now is 06:58 AM.

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