LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 08-15-2006, 05:54 AM   #1
tripmix
Member
 
Registered: Nov 2004
Location: Norway
Distribution: Debian mostly
Posts: 107

Rep: Reputation: 16
Premissions change for many files?


I got some new disks and I'v copied some old disks to the new ones and now everything belongs to root. So I was wondering if there is a way to change premissions on all my files at once? It's only media so it's OK if everyone gets premission.

Plz be clear, I know next to nothing about premissions and user groups and stuff.
 
Old 08-15-2006, 06:07 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
First you really should know something about permissions. After that you just use a recursion..if you wanted to make the new owner of those files be tripmix, and the files would reside in /mnt/somedir/, you could simply use (change the directories and owner name according to your own configuratoin):
Code:
chown -R tripmix /mnt/somedir
Or use chmod to se up read/write/execute permissions. Ownership is changed with chown as above.

EDIT: sorry it was a big -R not a small -r in the codeline

EDIT II: the files are probably owned by user root and group root, so if you wanted, you could alter the group too:
Code:
chown -R tripmix:tripmix /mnt/somedir
The above would go recursively through /mnt/somedir (i.e. working on every file and subdirectory), changing the owner of the files to be tripmix (the name before ":") and changing the group those files are owned by to be tripmix (the name after ":"). The group ownership is not a "must" to be changed, especially if it's root - the point is, it shouldn't be any such group that everybody can get access to.

Removing read, write and execution permissions from every other user than the owner and those belonging to the owning group would go like:
Code:
chmod -R o-rwx /mnt/somedir
if you liked. You should read
Code:
man chown
man chmod
to get more information. It's a really good idea to be aware of how users and groups work and affect the file usage, and how they are set up - simply because it's a big part of the security of your system.

Last edited by b0uncer; 08-15-2006 at 06:18 AM.
 
Old 08-15-2006, 06:16 AM   #3
tripmix
Member
 
Registered: Nov 2004
Location: Norway
Distribution: Debian mostly
Posts: 107

Original Poster
Rep: Reputation: 16
Thanks alot! that worked like a charm And your right, I should read up on the premission thing. till the day I die...
 
Old 08-15-2006, 06:36 AM   #4
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
No problem it's generally a good idea to learn since without better knowledge you could "accidentally" let some weird group be an owner of those files, and if somebody got to become a member of that group, s/he could access the files with ease. For a file (or a directory, which is actually just a special file) you can set an owner and a group that owns the file, and then you can set read-, write- and execute permissions for the owner, for the owner group and for all other users on the system. Generally it's the safest to not let anybody read nor execute nor (especially) write to the files, if it's not needed. Minimal permissions are the most secure ones.
 
  


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
User premissions?? skate Linux - Newbie 3 06-02-2005 10:06 AM
Folder premissions windsurf Linux - Newbie 3 06-02-2005 09:46 AM
premissions for ports mdk Linux - Newbie 3 09-16-2004 01:40 PM
premissions? Nohbudy Linux - Newbie 5 08-29-2004 10:56 AM
quake 2/3 premissions Beav Linux - General 3 10-03-2002 01:01 AM


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