Hello! I made a typo which resulted in chown -R xxx:yyy / The owner and group information was changed on /bin /dev and /etc before my frantic control-c stopped the process. I have rpm -Va --nomd5 and have a list of files whose owner and/or group need to be changed back. Is there a way I can get rpm to reset just this information? Is there a way I can extract what the owner and group should be for this set of files? Any other suggestions? thanks much in advance!! Steven Marcus __________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/
On Thu, 17 Jan 2002 21:43:44 -0800 (PST), Steven Marcus
I made a typo which resulted in chown -R xxx:yyy /
Yee gods! Don't do that! ;| I wouldn't know how to get just the right owners in each and every file, but you might look at xargs as a way of running chown on part or all of that list. If your list includes the right owners, maybe you can grep the lines for each owner in turn and use xargs to change all the files in each subset. But don't ask me for a script, for it would take me too long to work it out. You should post a sample of your list. By the way, what's rpm -Va --nomd5 do? HTH --Jason
At 10:16 PM 1/17/2002 -0800, you wrote:
On Thu, 17 Jan 2002 21:43:44 -0800 (PST), Steven Marcus
stammered: I made a typo which resulted in chown -R xxx:yyy /
Yee gods! Don't do that! ;|
No kidding. You've got to be careful on the command line. You did that as root?
I wouldn't know how to get just the right owners in each and every file, but you might look at xargs as a way of running chown on part or all of that list. If your list includes the right owners, maybe you can grep the lines for each owner in turn and use xargs to change all the files in each subset. But don't ask me for a script, for it would take me too long to work it out. You should post a sample of your list. By the way, what's rpm -Va --nomd5 do?
If you're totally messed up, consider doing the following: either look at ownerships in /etc/permissions.* for ownership ideas and set them accordingly, or I'd do and ls -lR / and save it all to a text file (Now _that_ will take a long time) That way at least you'll know your current _permissions_ Then set CHECK_PERMISSIONS in yast to either "warn" if you want a list mailed to you and you want to set them by hand, or set it to "set" to have yast do it for you. This will set both ownership and permissions of many core files based on your security level, defined in PERMISSION_SECURITY and what's defined in /etc/permissions.* per PERMISSION_SECURITY . I'd suggest setting PERMISSION_SECURITY to secure local because it includes the largest amount of files. Note however that you will then have a very tight system. After SuSEconfig runs, set PERMISSION_SECURITY back to "easy local" if that's what you want. Think about the implications of all of the above before you commit yourself.
HTH
--Jason
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq and the archives at http://lists.suse.com
---------------------------------------------------- Jonathan Wilson System Administrator Cedar Creek Software http://www.cedarcreeksoftware.com Central Texas IT http://www.centraltexasit.com
* JW (jw@centraltexasit.com) [020117 22:32]:
At 10:16 PM 1/17/2002 -0800, you wrote:
On Thu, 17 Jan 2002 21:43:44 -0800 (PST), Steven Marcus
stammered: I made a typo which resulted in chown -R xxx:yyy / No kidding. You've got to be careful on the command line. You did that as root?
A good example of why / should be on a separate filesystem from /var, /home, and /tmp and mounted readonly. If you don't want to do that, at least chattr +i if using ext2 or chmod -w if using reiserfs. Also, having an up to date tripwire database would help here as well.
either look at ownerships in /etc/permissions.* for ownership ideas and set them accordingly, or
Just make sure /etc/rc.config has CHECK_PERMISSIONS="set" and run SuSEconfig; it will set what's in /etc/permissions and /etc/permissions.local. Probably the easiest fix is to just force a reinstallation of all of the installed packages starting with devs and aaa_base. -- -ckm
Steven Marcus
I made a typo which resulted in chown -R xxx:yyy /
The owner and group information was changed on /bin /dev and /etc before my frantic control-c stopped the process.
I have rpm -Va --nomd5 and have a list of files whose owner and/or group need to be changed back.
Have a look at the following (slow) script. You can supply your list of files there by replacing "find" with "cat filelist". #!/bin/bash find /dev /etc -print \ | while read fname; do ans=$(rpm -qf --queryformat "%{FILEUSERNAME}.%{FILEGROUPNAME}" "$fname" 2>/dev/null) if [[ $? -eq 0 ]]; then echo "chown $ans $fname" fi done There are more ways how to fix the ownership. -- Alexandr.Malusek@imv.liu.se
participants (5)
-
Alexandr Malusek
-
Christopher Mahmood
-
Jason A.Van Cleve
-
JW
-
Steven Marcus