LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-30-2006, 09:38 PM   #1
mattd7591
Member
 
Registered: Jun 2006
Distribution: Debian Etch
Posts: 92

Rep: Reputation: 15
mass file permission change help


Basically Ive been using for a few weeks. Ive been letting family memebers test it out on my login. One reaaly likes it and the way I set it up. SO i created a new user name and copied the home directory. only thing is everything is still the originail user's ownership.
is there a way without setting each file

So basically Im asking can I do it from a directory, then have the result of:
Root directory (/home/<user>)
root directory files and sub-folders
sub-folder files and more subfolder
etc
?
root meaning top, not root account
 
Old 07-30-2006, 09:43 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
From /home type

chmod -R username : groupname username

Leave the spaces out before and after the colon - it makes I face if you don't post with the spaces though
 
Old 07-30-2006, 09:43 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,242

Rep: Reputation: 8077Reputation: 8077Reputation: 8077Reputation: 8077Reputation: 8077Reputation: 8077Reputation: 8077Reputation: 8077Reputation: 8077Reputation: 8077Reputation: 8077
Quote:
Originally Posted by mattd7591
Basically Ive been using for a few weeks. Ive been letting family memebers test it out on my login. One reaaly likes it and the way I set it up. SO i created a new user name and copied the home directory. only thing is everything is still the originail user's ownership.
is there a way without setting each file

So basically Im asking can I do it from a directory, then have the result of:
Root directory (/home/<user>)
root directory files and sub-folders
sub-folder files and more subfolder
etc
?
root meaning top, not root account

Try this:

chown -R <user name>:<user group> /home/<user>

So if the user's name is bob, and he's in the users group

chown -R bob:users /home/bob

That will get all the files/directories/sub-directories, but leave the file-permissions alone. If you don't want to bother with the user-groups, just omit that parameter from the command.
 
Old 07-31-2006, 05:19 AM   #4
live_dont_exist
Member
 
Registered: Aug 2004
Location: India
Distribution: Redhat 9.0,FC3,FC5,FC10
Posts: 257

Rep: Reputation: 30
To add to what TB0ne said.. use chown -Rh instead of chown -R so your symbolic links(if any) dont get messed up ...

But I'm still curious..when u created a new user surely the permissions on the directory u mentioned would be that of the new user and not that of root or the original user...
 
Old 07-31-2006, 11:03 AM   #5
mattd7591
Member
 
Registered: Jun 2006
Distribution: Debian Etch
Posts: 92

Original Poster
Rep: Reputation: 15
Thank You it worked.
I believed the directory changed ownership to the new user, but not the files
Thansk for the help
 
  


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
mass change to file ggerofsky Linux - General 1 04-05-2006 08:27 PM
how to change the file permission ?? AK prince Slackware 17 08-05-2005 01:16 PM
using chmod to change file permission kiwidoc Linux - Newbie 3 07-25-2004 07:39 AM
Cannot Change File Permission dsuratman Linux - Newbie 12 11-03-2003 02:47 PM
cp command change the file permission? myunicom Linux - General 6 09-24-2003 09:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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