Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
I was trying to change the permissions of a folder but was one directory off from where i thought i was and ran:
chmod -R 755 *
in / as root. I seem to have fixed most of the related problems (ssh gets a bit snippy if you make your private keys public)
But have still encountered a couple problems that i can't quite trackdown. Mainly, i use eclipse (I'd post a link but it seems i'm just not cool enough for that yet) for programming and it works fine when i run it as root, but crashes when i run normal. this is the main problem i am trying to fix.
So, is there a quick and easy (perhaps as quick and easy as what caused the problem ?) fix to reset all my permissions back to default?
yeah, i once did a rm -rfd * in the wrong directory. The sysadmin at school heard me yelling and told me about the backup directory that keeps a copy of every file we create on the school server. He looked at me funny when i tried to kiss him.
Linux conf checks a number of file permissions on exit. Maybe you should give it a go. Bastille also provides filesystem hardening, ie checks that the right permissions are set on the right things.
Granted, that won't be your defaults but should be good.
This is an uneducated attempt to solve the same problem. I couldn't log in as root or any other user after an idiot chmod operation on my root directory as root. My redhat 9 install disk and went into rescue mode. Then I did a chroot /mnt/sysimage followed by an su, just to be sure I had root priveleges (I'm shaking now.) I ran rpm -qa to see if rpm was querying ok. Then I ran rpm -qa |xargs rpm --setperms. This took about ten minutes to complete. Then I logged into my system successfully. There were still some problems with perms on files in my /tmp directory. So I did another uneducated thing and deleted the contents of /tmp. (Well, it sounded better than reinstalling.) There seem to be a few problems with the configuration files in my home directory, but everything is working now and my configurations are mostly preserved. My only problem encountered so far is with my mailer, evolution which I'm in the process of reinstalling now. Looks pretty. healthy otherwise. So how stupid am I?
Just as an update, I'd like to confirm that the process that I described seems to have been successful. To straighten out my home directory issues, I did the following:
I figured I don't have many executables there, but the few that need executable perms can be set individually if/when the need arises. The only other thing I did by hand was to remove any group or other priveleges from my /etc/ssh/*key* files (chmod go-rwx /etc/ssh/*) This made ssh happy and I'm back to normal as far as I can tell.
Criticisms are welcome. If there is anything I've overlooked please tell me.
To find files that have the mode 755 on my RH9 system I did:
# rm -f ~/unowned-755-files.lst
# for f in `find / -xdev -type f -perm 755`; do rpm -qf $f >/dev/null 2>&1 || echo $f |tee -a ~/unowned-755-files.lst; done
For my RH9 system it only came up with 3 files in /etc excluding a whole lot of xml files in /etc/gconf/gconf.xml.defaults that shouldn't have this mode. If you try this then do the for loop for each mount point like /usr etc.
Once you have the list of files then you'll have to analyse it manually to see if anything sticks out as having the mode 755 that shouldn't. You'd expect files in the bin directories to be that mode and in the lib directories but not much elsewhere.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.