Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So I had a new developer working on a new VM with RHEL on it and they typod a chmod command and accidentally executed chmod -r 777 /* via sudo and it seems to have messed something up. We can't login remotely, the GUI on the console won't seem to take anyone to a desktop, it just keeps coming back to the login screen. I can't even choose a console login from the GUI login prompt, as it bounces back to the GUI login screen after a minute or so.
I have not taken it down to single user mode yet as I thought I would get some suggestions on how to proceed and potential damage caused. It looks like chmod command has some protection built in when doing recursive actions against / but obviously something is still messed up.
I was able to get it into single user mode, but given the extend of the repairs (over 900 individual packages) and the time involved vs rebuilding the server I have proceeded to rebuild the server. Once its rebuild I will make a snapshot.. which I had not done. Since these are sandbox VM's we were not actively making snapshots but I think that will change soon. Thanks for your help!
So I had a new developer working on a new VM with RHEL on it and they typod a chmod command and accidentally executed chmod -r 777 /* via sudo and it seems to have messed something up. We can't login remotely, the GUI on the console won't seem to take anyone to a desktop, it just keeps coming back to the login screen. I can't even choose a console login from the GUI login prompt, as it bounces back to the GUI login screen after a minute or so.
I have not taken it down to single user mode yet as I thought I would get some suggestions on how to proceed and potential damage caused. It looks like chmod command has some protection built in when doing recursive actions against / but obviously something is still messed up.
One of our lead developers had a full sudo access to our main DB server- and he ran the 'chmod -r 777 /' command. As you can probably expect, nothing was working. This was a production database- and we needed it to be back as soon as possible.
Next, restores all permissions as it was when the original RPMs were installed. Note that this can be dangerous- as sometimes it is necessary to change permissions for some applications to function.
Quote:
for p in $(rpm -qa); do rpm --setperms $p; done
for p in $(rpm -qa); do rpm --setugids $p; done
Next step fix problems due to the previous steps. And finally fix permissions for all everything else manually.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.