How to correct a chmod +x * -R command
Hello all and Merry Christmas, I have done a stupid thing and issued a chmod +x * -R command while in the / directory. This is on an internal server, not connected to the 'net. I had thought I was in my /public directory but wasn't. The command stopped with an error when it got to the /proc directory but by then it was too late. What are the consequences here and what can I do to rectify them? All help appreciated Keith Gibbons
* Keith Gibbons, StarDate Computers. <stardatecomputers@eircom.net> [Dec 29. 2003 18:47]:
Hello all and Merry Christmas, I have done a stupid thing and issued a chmod +x * -R command while in the / directory. This is on an internal server, not connected to the 'net. I had thought I was in my /public directory but wasn't. The command stopped with an error when it got to the /proc directory but by then it was too late. What are the consequences here and what can I do to rectify them?
I've done that too a loooong time ago, and the only way to go back is to reinstall. -- Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogical, with just a little bit more effort?" -- A. P. J.
On Monday 29 December 2003 12:55 pm, Mads Martin Joergensen wrote:
* Keith Gibbons, StarDate Computers. <stardatecomputers@eircom.net> [Dec 29. 2003 18:47]:
Hello all and Merry Christmas, I have done a stupid thing and issued a chmod +x * -R command while in the / directory. This is on an internal server, not connected to the 'net. I had thought I was in my /public directory but wasn't. The command stopped with an error when it got to the /proc directory but by then it was too late. What are the consequences here and what can I do to rectify them?
I've done that too a loooong time ago, and the only way to go back is to reinstall.
Since this is an internal system and security doesn't seem to be an issue, I'd say "live with it, and remove the x attribute when it causes trouble on a specific file". I don't think there's an easy way to tell if a particular file is supposed to be executable. The alternative is to go the other way and remove it on all non-directory files other than the ones in "bin" directories, then add it in when you find it's needed. Probably less aggravating than reinstalling. Another thought: if you update all the packages in your system, you'll restore the correct permissions in all of them. That won't damage your private data. Paul
On Mon, 29 Dec 2003, Keith Gibbons, StarDate Computers. wrote:
Hello all and Merry Christmas, I have done a stupid thing and issued a chmod +x * -R command while in the / directory. This is on an internal server, not connected to the 'net. I had thought I was in my /public directory but wasn't. The command stopped with an error when it got to the /proc directory but by then it was too late. What are the consequences here and what can I do to rectify them?
All help appreciated
Keith Gibbons
This is why my backup strategy starts with ls -al / > /backup/listoffiles rpm -qa > /backup/listofpackages rpm -qia > /backup/descriptionofpackages (and other commands like this, like fdisk -l to dump the partitions) It makes recovery from this kind of thing much easier to script. In fact, once I blew away my RPM database and was able to rebuild the db from the listofpackages file by specifying the RPM option to just update the DB and not actually install the package. -- DDDD David Kramer david@thekramers.net http://thekramers.net DK KD DKK D "LINUX is obsolete" DK KD - Andrew S. Tanenbaum, creator of Minix - Jan 29, 1992 DDDD
Keith Gibbons, StarDate Computers. wrote:
Hello all and Merry Christmas, I have done a stupid thing and issued a chmod +x * -R command while in the / directory. This is on an internal server, not connected to the 'net. I had thought I was in my /public directory but wasn't. The command stopped with an error when it got to the /proc directory but by then it was too late. What are the consequences here and what can I do to rectify them?
All help appreciated
Keith Gibbons
The contents of /proc disappear when you reboot/shutdown, it's not permanent, e.g take a disk out and put it in another box and mount it as /some_directory and you'll see that /some_directory/proc is empty, boot off it and the stuff is there again. It gets built on bootup. Regards Sid. -- Sid Boyce .... Hamradio G3VBV and keen Flyer Linux Only Shop.
"Keith Gibbons, StarDate Computers." <stardatecomputers@eircom.net> writes:
I have done a stupid thing and issued a chmod +x * -R command while in the / directory.
You may experiment with "rpm -Va" or rpm -q --queryformat '[%{FILEMODES:perms} %{FILENAMES}\n]' packagename For instance rpm -q --queryformat '[%{FILEMODES:perms} %{FILENAMES}\n]' rpm -rwxr-xr-x /bin/rpm -rwxr-xr-x /etc/init.d/rpmconfigcheck ... -- A.M.
On Tue, Dec 30, 2003 at 12:14:28AM +0100, Alexandr Malusek wrote:
"Keith Gibbons, StarDate Computers." <stardatecomputers@eircom.net> writes:
I have done a stupid thing and issued a chmod +x * -R command while in the / directory.
You may experiment with "rpm -Va" or
rpm -q --queryformat '[%{FILEMODES:perms} %{FILENAMES}\n]' packagename
For instance
rpm -q --queryformat '[%{FILEMODES:perms} %{FILENAMES}\n]' rpm -rwxr-xr-x /bin/rpm -rwxr-xr-x /etc/init.d/rpmconfigcheck ...
There's a lot of work there... :-P Without having this completely thought through, wouldn't just running SuSEconfig rectify most of it? I mean there's /etc/permissions* which basically holds precisely permissions info... And I've often enough gotten pretty frustrated by SuSEconfig changing permissions back, until I found out why... HTH /Jon -- Whatever rocks your boat!
Jon Clausen <dsl23212@vip.cybercity.dk> writes:
I have done a stupid thing and issued a chmod +x * -R command while in the / directory.
You may experiment with "rpm -Va" or
rpm -q --queryformat '[%{FILEMODES:perms} %{FILENAMES}\n]' packagename
There's a lot of work there... :-P
I guess a 4-5 lines script can do it. It's not difficult nevertheless some time must be spend on testing since a bug can make the system unusable. -- A.M.
Jon Clausen <dsl23212@vip.cybercity.dk> writes:
I have done a stupid thing and issued a chmod +x * -R command while in the / directory.
Without having this completely thought through, wouldn't just running SuSEconfig rectify most of it?
I mean there's /etc/permissions* which basically holds precisely permissions info...
Only a small subset of file permissions is listed there. The suggested "rpm --setperms package" is the way to go, SuSEconfig then may adjust some permissions according to the security level. -- A.M.
participants (7)
-
Alexandr Malusek
-
David Kramer
-
Jon Clausen
-
Keith Gibbons, StarDate Computers.
-
Mads Martin Joergensen
-
Paul W. Abrahams
-
Sid Boyce