Basically, what I typed was: chown -R user2:user2 * chown -R user2:user2 .* chown -R user2:user2 *.* ...all in /home. Duh. I forgot which way recursive went. So, I then did: chown -R root:root * chown -R root:root .* chown -R root:root *.* ...this time in / to try and f things. Duh again. Other items need to have other owners & groups.
So, how can I fix this? In MacOSX, there is a utility to fix all permissions on the system. Is there a similar item in CentOS?
Here's what I originally wanted to do: Started with user1. Got everything setup just right. Then created user2. I wanted to use all the settings, mail, etc. from user1 for user2. My thought was to just copy everything in /home/user1 to /home/user2, then use chown on all of the files. This is where I got myself into this pickle...
Any ideas?
On Monday 12 February 2007 21:34, David A. Woyciesjes wrote: ...
So, how can I fix this? In MacOSX, there is a utility to fix all permissions on the system. Is there a similar item in CentOS?
The rpm-databse contains all you need to know (almost, it wont cover files not owned by any package). "rpm -V PKG" will tell you if that package has files that have been modified since install, including uid:gid). The information can be obtained (dumped) with something like: # rpm --dump -ql PKG which would give you a list of all files in PKG and (among other things) their original uid:gid.
I know of no automated way of restoring this so implementing x (rpm --dump -qal | x ) is left as an exercise ;-)
/Peter
I know of no automated way of restoring this so implementing x (rpm --dump -qal | x ) is left as an exercise ;-)
You mean like rpm's --setperms and --setugids options, which restore files owned by an rpm to their original permissions/owner states? :-P
This will not fix permissions issues in /home/<user> however as those files are almost assuredly not owned by an rpm.
On Monday 12 February 2007 22:02, Jim Perrin wrote:
I know of no automated way of restoring this so implementing x (rpm --dump -qal | x ) is left as an exercise ;-)
You mean like rpm's --setperms and --setugids options, which restore files owned by an rpm to their original permissions/owner states? :-P
hehe, yes, exactly like those ;-) I don't think finding that information was too hard an exercise? hehe.
/Peter
David A. Woyciesjes spake the following on 2/12/2007 12:34 PM:
Basically, what I typed was:
chown -R user2:user2 * chown -R user2:user2 .* chown -R user2:user2 *.* ...all in /home. Duh. I forgot which way recursive went. So, I then did: chown -R root:root * chown -R root:root .* chown -R root:root *.* ...this time in / to try and f things. Duh again. Other items need to have other owners & groups.
So, how can I fix this? In MacOSX, there is a utility to fix all
permissions on the system. Is there a similar item in CentOS?
Here's what I originally wanted to do:
Started with user1. Got everything setup just right. Then created user2. I wanted to use all the settings, mail, etc. from user1 for user2. My thought was to just copy everything in /home/user1 to /home/user2, then use chown on all of the files. This is where I got myself into this pickle...
Any ideas?
Is this a production machine? You might be damaged beyond a reasonable repair. It can be done, but will be a lot of work. Any possibility of a backup and re-install?
I don't know of an easy way to fix this. Root is dangerous!
Each directory in /home needs to be chown'd to the owner. IE.. chown -R user1name:user1group /home/user1. The rest of the structure will be tough to repair, as many files and directories are owned by other processes. It will be some work to get everything right. If not a production system, or just starting out, you could delete users, delete home directories, and redo users. If you want users set up a certain way on creation, you put the changes into /etc/skel and they will get copied to the new users directory and chown'd to the newuser when accounts are created.
Scott Silva wrote:
I don't know of an easy way to fix this. Root is dangerous!
Guns aren't dangerous. People are dangerous.
Anyway. In case one wanted to do a little chown'ing above and beyond the scope of most necessity again, the proper way to deal with the -R recursion nightmare is by executing it on .??* and ??*.
That will, of course skip anything that has a 2-character name, but that's usually okay, because it will keep you from recursively chown'ing "..".
Just in case nobody comes out and says it..
Peter
Quoting Peter Serwe peter@infostreet.com:
Scott Silva wrote:
I don't know of an easy way to fix this. Root is dangerous!
Guns aren't dangerous. People are dangerous.
Anyway. In case one wanted to do a little chown'ing above and beyond the scope of most necessity again, the proper way to deal with the -R recursion nightmare is by executing it on .??* and ??*.
That will, of course skip anything that has a 2-character name, but that's usually okay, because it will keep you from recursively chown'ing "..".
Just in case nobody comes out and says it..
Peter
Yep, seems that is how I shot myself in the foot. Thankfully it's still attached. But that command will go into the subfolders, though, correct?
Another suggestion I got, that I should've done, was '/home/user2/chown user2:user2 ../user2/*'. But I think that one is missing something... I may have remembered it wrong. Should've wrote it down...
CentOS mailing list centos@centos.org writes:
Anyway. In case one wanted to do a little chown'ing above and beyond the scope of most necessity again, the proper way to deal with the -R recursion nightmare is by executing it on .??* and ??*. That will, of course skip anything that has a 2-character name, but that's usually okay, because it will keep you from recursively chown'ing "..". Just in case nobody comes out and says it.. Peter -- Peter Serwe <peter at infostreet dot com>
A much easier concept would be to:
chown -R user2:user2 ~user2
which will implicitly recurse through that directory. There's normally no reason the user's home directory itself shouldn't be owned by the user.
-Adam Thompson Divisional IT Department, St. James-Assiniboia School Division 150 Moray St., Winnipeg, MB, R3J 3A2 athompson@sjsd.net / tel: (204) 837-5886 x222 / fax: (204) 885-3178
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of David A. Woyciesjes Sent: Monday, February 12, 2007 3:35 PM To: CentOS Subject: [CentOS] chown command goof up
Basically, what I typed was: chown -R user2:user2 * chown -R user2:user2 .* chown -R user2:user2 *.* ...all in /home. Duh. I forgot which way recursive went. So, I then did: chown -R root:root * chown -R root:root .* chown -R root:root *.* ...this time in / to try and f things. Duh again. Other items need to have other owners & groups.
So, how can I fix this? In MacOSX, there is a utility to fix all permissions on the system. Is there a similar item in CentOS?
Here's what I originally wanted to do: Started with user1. Got everything setup just right. Then created user2. I wanted to use all the settings, mail, etc. from user1 for user2. My thought was to just copy everything in /home/user1 to /home/user2, then use chown on all of the files. This is where I got myself into this pickle...
Any ideas?
In case nobody just comes out and says it.
# rpm --setperms `rpm -qa` # rpm --setugids `rpm -qa`
Should fix it.
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
Ross S. W. Walker wrote:
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of David A. Woyciesjes Sent: Monday, February 12, 2007 3:35 PM To: CentOS Subject: [CentOS] chown command goof up
Basically, what I typed was: chown -R user2:user2 * chown -R user2:user2 .* chown -R user2:user2 *.* ...all in /home. Duh. I forgot which way recursive went. So, I then did: chown -R root:root * chown -R root:root .* chown -R root:root *.* ...this time in / to try and f things. Duh again. Other items need to have other owners & groups.
So, how can I fix this? In MacOSX, there is a utility to fix all permissions on the system. Is there a similar item in CentOS?
Here's what I originally wanted to do: Started with user1. Got everything setup just right. Then created user2. I wanted to use all the settings, mail, etc. from user1 for user2. My thought was to just copy everything in /home/user1 to /home/user2, then use chown on all of the files. This is where I got myself into this pickle...
Any ideas?
In case nobody just comes out and says it.
# rpm --setperms `rpm -qa` # rpm --setugids `rpm -qa`
Should fix it.
-Ross
Wow! Never knew this one.
I have re-read TFM, but there isnt much about the --set* options - could this be used daily as a 'tidy up' sort of routine? or would it screw with *.conf ?
rkhunter currently looks for sus executable files, this could reset perms on everything system related?
This is what i love about the style of packaging with rpm - you know what happens in an install (and can repeat it!), rather than 'black box' installations with windose where you can never be sure what happened or if a 'refresh' will rewrite local configs.
Regards,
MrKiwi
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of MrKiwi Sent: Monday, February 12, 2007 4:50 PM To: CentOS mailing list Subject: Re: [CentOS] chown command goof up
Ross S. W. Walker wrote:
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of David A. Woyciesjes Sent: Monday, February 12, 2007 3:35 PM To: CentOS Subject: [CentOS] chown command goof up
Basically, what I typed was: chown -R user2:user2 * chown -R user2:user2 .* chown -R user2:user2 *.* ...all in /home. Duh. I forgot which way recursive went. So, I then did: chown -R root:root * chown -R root:root .* chown -R root:root *.* ...this time in / to try and f things. Duh again. Other
items need to
have other owners & groups.
So, how can I fix this? In MacOSX, there is a utility to fix all permissions on the system. Is there a similar item in CentOS?
Here's what I originally wanted to do: Started with user1. Got everything setup just right. Then created user2. I wanted to use all the settings, mail, etc. from user1
for user2. My
thought was to just copy everything in /home/user1 to /home/user2, then use chown on all of the files. This is where I got myself
into this
pickle...
Any ideas?
In case nobody just comes out and says it.
# rpm --setperms `rpm -qa` # rpm --setugids `rpm -qa`
Should fix it.
-Ross
Wow! Never knew this one.
I have re-read TFM, but there isnt much about the --set* options - could this be used daily as a 'tidy up' sort of routine? or would it screw with *.conf ?
rkhunter currently looks for sus executable files, this could reset perms on everything system related?
This is what i love about the style of packaging with rpm - you know what happens in an install (and can repeat it!), rather than 'black box' installations with windose where you can never be sure what happened or if a 'refresh' will rewrite local configs.
These options are poorly documented and well needed.
They're basically aliases for compounded rpm commands, basically query for specific package tags and execute chown/chmod with them.
Google for "rpm setperms setugids"
Some people have them well documented in their wikis.
I think the aliases are defined somewhere, maybe in /usr/lib/rpm or some subdir there, you can probably add your own there too.
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Ross S. W. Walker Sent: Monday, February 12, 2007 5:11 PM To: CentOS mailing list Subject: RE: [CentOS] chown command goof up
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of MrKiwi Sent: Monday, February 12, 2007 4:50 PM To: CentOS mailing list Subject: Re: [CentOS] chown command goof up
Ross S. W. Walker wrote:
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of David A.
Woyciesjes
Sent: Monday, February 12, 2007 3:35 PM To: CentOS Subject: [CentOS] chown command goof up
Basically, what I typed was: chown -R user2:user2 * chown -R user2:user2 .* chown -R user2:user2 *.* ...all in /home. Duh. I forgot which way recursive went. So, I then did: chown -R root:root * chown -R root:root .* chown -R root:root *.* ...this time in / to try and f things. Duh again. Other
items need to
have other owners & groups.
So, how can I fix this? In MacOSX, there is a utility to fix all permissions on the system. Is there a similar item in CentOS?
Here's what I originally wanted to do: Started with user1. Got everything setup just right. Then created user2. I wanted to use all the settings, mail, etc. from user1
for user2. My
thought was to just copy everything in /home/user1 to /home/user2, then use chown on all of the files. This is where I got myself
into this
pickle...
Any ideas?
In case nobody just comes out and says it.
# rpm --setperms `rpm -qa` # rpm --setugids `rpm -qa`
Should fix it.
-Ross
Wow! Never knew this one.
I have re-read TFM, but there isnt much about the --set* options - could this be used daily as a 'tidy up' sort of routine? or would it screw with *.conf ?
rkhunter currently looks for sus executable files, this could reset perms on everything system related?
This is what i love about the style of packaging with rpm - you know what happens in an install (and can repeat it!), rather than 'black box' installations with windose where you can never be sure what happened or if a 'refresh' will rewrite local configs.
These options are poorly documented and well needed.
They're basically aliases for compounded rpm commands, basically query for specific package tags and execute chown/chmod with them.
Google for "rpm setperms setugids"
Some people have them well documented in their wikis.
I think the aliases are defined somewhere, maybe in /usr/lib/rpm or some subdir there, you can probably add your own there too.
Yup, just popt aliases, found in /usr/lib/rpm/rpmpopt-4.3.3
rpm alias --setperms -q --qf '[[ -L %{FILENAMES:shescape} ] || chmod %7.7{FILEMODES:octal} %{FILENAMES:shescape}\n]' \ --pipe "grep -v (none) | sed 's/chmod .../chmod /' | sh" \ --POPTdesc=$"set permissions of files in a package"
rpm alias --setugids -q --qf \ '[ch %{FILEUSERNAME:shescape} %{FILEGROUPNAME:shescape} %{FILENAMES:shescape}\n]' \ --pipe "(echo 'ch() { chown -- "$1" "$3";chgrp -- "$2" "$3"; }';grep -v (none))|sh" \ --POPTdesc=$"set user/group ownership of files in a package"
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
Quoting "Ross S. W. Walker" rwalker@medallion.com:
Yup, just popt aliases, found in /usr/lib/rpm/rpmpopt-4.3.3
rpm alias --setperms -q --qf '[[ -L %{FILENAMES:shescape} ] || chmod %7.7{FILEMODES:octal} %{FILENAMES:shescape}\n]' \ --pipe "grep -v (none) | sed 's/chmod .../chmod /' | sh" \ --POPTdesc=$"set permissions of files in a package"
rpm alias --setugids -q --qf \ '[ch %{FILEUSERNAME:shescape} %{FILEGROUPNAME:shescape} %{FILENAMES:shescape}\n]' \ --pipe "(echo 'ch() { chown -- "$1" "$3";chgrp -- "$2" "$3"; }';grep -v (none))|sh" \ --POPTdesc=$"set user/group ownership of files in a package"
So if I'm following this right, then I just need to run rpm --setugids `rpm -qa` as root, from /, and this should set the owner & groups on all files, as appropriate? Except for of course the files in /home? As for my original plan, I saw krename in yum. At first glance, that looks like it should do what I wanted. Anyone have experience with it?
-----Original Message----- From: David Woyciesjes [mailto:david.woyciesjes@yale.edu] Sent: Monday, February 12, 2007 7:09 PM To: CentOS mailing list; Ross S. W. Walker Cc: CentOS mailing list Subject: RE: [CentOS] chown command goof up
Quoting "Ross S. W. Walker" rwalker@medallion.com:
Yup, just popt aliases, found in /usr/lib/rpm/rpmpopt-4.3.3
rpm alias --setperms -q --qf '[[ -L %{FILENAMES:shescape} ] || chmod %7.7{FILEMODES:octal} %{FILENAMES:shescape}\n]' \ --pipe "grep -v (none) | sed 's/chmod
.../chmod /'
| sh" \ --POPTdesc=$"set permissions of files in a package"
rpm alias --setugids -q --qf \ '[ch %{FILEUSERNAME:shescape} %{FILEGROUPNAME:shescape} %{FILENAMES:shescape}\n]' \ --pipe "(echo 'ch() { chown -- "$1" "$3";chgrp -- "$2" "$3"; }';grep -v (none))|sh" \ --POPTdesc=$"set user/group ownership of files in a package"
So if I'm following this right, then I just need to run rpm --setugids `rpm -qa` as root, from /, and this should set the owner & groups on all files, as appropriate? Except for of course the files in /home? As for my original plan, I saw krename in yum. At first glance, that looks like it should do what I wanted. Anyone have experience with it?
Not sure what krename does, but yes an rpm --setugids `rpm -qa` and an rpm --setperms `rpm -qa` will reset all file perms and ownership for all files managed under RPM.
I gave a simple awk command to reset the perms in /home in an earlier post, basically using awk to parse the passwd fields and then issuing a shell statement with them.
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
Ross S. W. Walker wrote:
-----Original Message----- From: David Woyciesjes [mailto:david.woyciesjes@yale.edu]
So if I'm following this right, then I just need to run rpm --setugids `rpm -qa` as root, from /, and this should set the owner & groups on all files, as appropriate? Except for of course the files in /home? As for my original plan, I saw krename in yum. At first glance, that looks like it should do what I wanted. Anyone have experience with it?
Not sure what krename does, but yes an rpm --setugids `rpm -qa` and an rpm --setperms `rpm -qa` will reset all file perms and ownership for all files managed under RPM.
I gave a simple awk command to reset the perms in /home in an earlier post, basically using awk to parse the passwd fields and then issuing a shell statement with them.
Thanks Ross. I didn't do anything with file permissions (that I'm aware of), so I shouldn't have to use the --setperms, right?
Just tried rpm --setugids `rpm -qa`, and got "sh: line 2: package: command not found". Now to figure out where that one comes from...
David A. Woyciesjes spake the following on 2/13/2007 5:36 AM:
Ross S. W. Walker wrote:
-----Original Message----- From: David Woyciesjes [mailto:david.woyciesjes@yale.edu] So if I'm following this right, then I just need to run rpm --setugids `rpm -qa` as root, from /, and this should set the owner & groups on all files, as appropriate? Except for of course the files in /home? As for my original plan, I saw krename in yum. At first glance, that looks like it should do what I wanted. Anyone have experience with it?
Not sure what krename does, but yes an rpm --setugids `rpm -qa` and an rpm --setperms `rpm -qa` will reset all file perms and ownership for all files managed under RPM.
I gave a simple awk command to reset the perms in /home in an earlier post, basically using awk to parse the passwd fields and then issuing a shell statement with them.
Thanks Ross. I didn't do anything with file permissions (that I'm
aware of), so I shouldn't have to use the --setperms, right?
Just tried rpm --setugids `rpm -qa`, and got "sh: line 2: package:
command not found". Now to figure out where that one comes from...
Check your quotes. That just might be rpm --setugids `rpm -qa'
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Scott Silva Sent: Tuesday, February 13, 2007 11:50 AM To: centos@centos.org Subject: [CentOS] Re: chown command goof up
David A. Woyciesjes spake the following on 2/13/2007 5:36 AM:
Ross S. W. Walker wrote:
-----Original Message----- From: David Woyciesjes [mailto:david.woyciesjes@yale.edu] So if I'm following this right, then I just need to run rpm --setugids `rpm -qa` as root, from /, and this should set the owner &
groups on all
files, as appropriate? Except for of course the files in /home? As for my original plan, I saw krename in yum. At
first glance,
that looks like it should do what I wanted. Anyone have experience with it?
Not sure what krename does, but yes an rpm --setugids `rpm
-qa` and an
rpm --setperms `rpm -qa` will reset all file perms and
ownership for all
files managed under RPM.
I gave a simple awk command to reset the perms in /home in
an earlier
post, basically using awk to parse the passwd fields and
then issuing a
shell statement with them.
Thanks Ross. I didn't do anything with file permissions
(that I'm
aware of), so I shouldn't have to use the --setperms, right?
Just tried rpm --setugids `rpm -qa`, and got "sh: line
2: package:
command not found". Now to figure out where that one comes from...
Check your quotes. That just might be rpm --setugids `rpm -qa'
Quotes are correct I think he has popt uninstalled and so it is barfing on the alias command.
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of David A. Woyciesjes Sent: Tuesday, February 13, 2007 8:36 AM To: CentOS mailing list Subject: Re: [CentOS] chown command goof up
Ross S. W. Walker wrote:
-----Original Message----- From: David Woyciesjes [mailto:david.woyciesjes@yale.edu]
So if I'm following this right, then I just need to run rpm --setugids `rpm -qa` as root, from /, and this should set the owner & groups on all files, as appropriate? Except for of course the files in /home? As for my original plan, I saw krename in yum. At first glance, that looks like it should do what I wanted. Anyone have experience with it?
Not sure what krename does, but yes an rpm --setugids `rpm
-qa` and an
rpm --setperms `rpm -qa` will reset all file perms and
ownership for all
files managed under RPM.
I gave a simple awk command to reset the perms in /home in
an earlier
post, basically using awk to parse the passwd fields and
then issuing a
shell statement with them.
Thanks Ross. I didn't do anything with file permissions (that I'm aware of), so I shouldn't have to use the --setperms, right?
Just tried rpm --setugids `rpm -qa`, and got "sh: line 2: package: command not found". Now to figure out where that one comes from...
Make sure popt is installed, which version of CentOS is this?
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
Ross S. W. Walker wrote:
-----Original Message----- From: centos-bounces@centos.org
Ross S. W. Walker wrote:
-----Original Message----- From: David Woyciesjes [mailto:david.woyciesjes@yale.edu]
So if I'm following this right, then I just need to run rpm --setugids `rpm -qa` as root, from /, and this should set the owner & groups on all files, as appropriate? Except for of course the files in /home? As for my original plan, I saw krename in yum. At first glance, that looks like it should do what I wanted. Anyone have experience with it?
Not sure what krename does, but yes an rpm --setugids `rpm
-qa` and an
rpm --setperms `rpm -qa` will reset all file perms and
ownership for all
files managed under RPM.
I gave a simple awk command to reset the perms in /home in
an earlier
post, basically using awk to parse the passwd fields and
then issuing a
shell statement with them.
Thanks Ross. I didn't do anything with file permissions (that I'm aware of), so I shouldn't have to use the --setperms, right?
Just tried rpm --setugids `rpm -qa`, and got "sh: line 2: package: command not found". Now to figure out where that one comes from...
Make sure popt is installed, which version of CentOS is this?
CentOS 4. Not finding it in Yumex...
David A. Woyciesjes wrote:
Ross S. W. Walker wrote:
Make sure popt is installed, which version of CentOS is this?
CentOS 4. Not finding it in Yumex...
No wait, it's installed...
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of David A. Woyciesjes Sent: Tuesday, February 13, 2007 12:52 PM To: David A. Woyciesjes; CentOS mailing list Subject: Re: [CentOS] chown command goof up
David A. Woyciesjes wrote:
Ross S. W. Walker wrote:
Make sure popt is installed, which version of CentOS is this?
CentOS 4. Not finding it in Yumex...
No wait, it's installed...
Ok, I was able to reproduce the error on my system.
The problem is you are using the straight, or forward ticks like ' beside the <Enter> key instead of the reverse, or back ticks like ` above the <Tab> key. Ticks important.
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
Ross S. W. Walker wrote:
-----Original Message----- From: centos-bounces@centos.org
David A. Woyciesjes wrote:
Ross S. W. Walker wrote:
Make sure popt is installed, which version of CentOS is this?
CentOS 4. Not finding it in Yumex...
No wait, it's installed...
Ok, I was able to reproduce the error on my system.
The problem is you are using the straight, or forward ticks like ' beside the <Enter> key instead of the reverse, or back ticks like ` above the <Tab> key. Ticks important.
Okay, Ill try that real quick before I reinstall..
David A. Woyciesjes wrote:
David A. Woyciesjes wrote:
Ross S. W. Walker wrote:
Make sure popt is installed, which version of CentOS is this?
CentOS 4. Not finding it in Yumex...
No wait, it's installed...
You know, I think I'm just going to re-install. I have /home as a separate physical drive, copied my xorg.conf there. Considering all this funkiness, I should probably wipe /, and not just go over the top of it, right?
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of David A. Woyciesjes Sent: Monday, February 12, 2007 3:35 PM To: CentOS Subject: [CentOS] chown command goof up
Basically, what I typed was: chown -R user2:user2 * chown -R user2:user2 .* chown -R user2:user2 *.* ...all in /home. Duh. I forgot which way recursive went. So, I then did: chown -R root:root * chown -R root:root .* chown -R root:root *.* ...this time in / to try and f things. Duh again. Other items need to have other owners & groups.
So, how can I fix this? In MacOSX, there is a utility to fix all permissions on the system. Is there a similar item in CentOS?
Here's what I originally wanted to do: Started with user1. Got everything setup just right. Then created user2. I wanted to use all the settings, mail, etc. from user1 for user2. My thought was to just copy everything in /home/user1 to /home/user2, then use chown on all of the files. This is where I got myself into this pickle...
Any ideas?
To fix the home dirs:
# getent passwd | awk -F: '{system("if [ -d "$6" ]; then chown -R "$3":"$4" "$6"; chmod -R 700 "$6";fi")}}'
This should set perms for all users (and services!) home directories, make sure the 700 is adequate for service accounts, which is probably is not.
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Ross S. W. Walker Sent: Monday, February 12, 2007 4:58 PM To: CentOS mailing list Subject: RE: [CentOS] chown command goof up
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of David A. Woyciesjes Sent: Monday, February 12, 2007 3:35 PM To: CentOS Subject: [CentOS] chown command goof up
Basically, what I typed was: chown -R user2:user2 * chown -R user2:user2 .* chown -R user2:user2 *.* ...all in /home. Duh. I forgot which way recursive went. So, I then did: chown -R root:root * chown -R root:root .* chown -R root:root *.* ...this time in / to try and f things. Duh again. Other
items need to
have other owners & groups.
So, how can I fix this? In MacOSX, there is a utility to fix all permissions on the system. Is there a similar item in CentOS?
Here's what I originally wanted to do: Started with user1. Got everything setup just right. Then created user2. I wanted to use all the settings, mail, etc. from user1 for
user2. My
thought was to just copy everything in /home/user1 to /home/user2, then use chown on all of the files. This is where I got myself into this pickle...
Any ideas?
To fix the home dirs:
# getent passwd | awk -F: '{system("if [ -d "$6" ]; then chown -R "$3":"$4" "$6"; chmod -R 700 "$6";fi")}}'
This should set perms for all users (and services!) home directories, make sure the 700 is adequate for service accounts, which is probably is not.
To avoid service account fubar:
# getent passwd | awk -F: '{system("if [ -d /home/"$1" ]; then chown -R "$3":"$4" /home/"$1"; chmod 700 /home/"$1"; fi")}'
That'll restrict it to just home directories in /home, if they are named after the usernames, if not, well you will need to write your own test case.
-Ross
______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.