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.
/etc/ holds system config files, you're not supposed to be able to edit them as a regular user, that's the point. This is also another reason why sudo-only distros are stupid, but that's an argument for another thread.
Boot into a live distro, mount your root partition, and chown everything back to what it's supposed to be. Hopefully you have a backup you can use for reference? Most of them should be root:root, but there are several critical exceptions. If you don't have a reference to go off of, you may end up wanting to chown them all to root:root and then install the same distro in a VM so you can see what they're supposed to be. And then chalk this up as a learning experience and never do it again
Whatever you use for a reference, the following could help you identify the outliers that aren't root:root
/etc/ holds system config files, you're not supposed to be able to edit them as a regular user, that's the point. This is also another reason why sudo-only distros are stupid, but that's an argument for another thread.
Boot into a live distro, mount your root partition, and chown everything back to what it's supposed to be. Hopefully you have a backup you can use for reference? Most of them should be root:root, but there are several critical exceptions. If you don't have a reference to go off of, you may end up wanting to chown them all to root:root and then install the same distro in a VM so you can see what they're supposed to be. And then chalk this up as a learning experience and never do it again
Whatever you use for a reference, the following could help you identify the outliers that aren't root:root
There are only 26 outliers on my CentOS 7 system, not too bad.
Well I'm VERY new to linux and had no idea that /etc was system files. Mostly because of what it was named. I just figured it was random information for installed programs. Also, I have no idea what you just told me to do. Is there a way to back up my files and reinstall linux?
Well I'm VERY new to linux and had no idea that /etc was system files. Mostly because of what it was named. I just figured it was random information for installed programs. Also, I have no idea what you just told me to do. Is there a way to back up my files and reinstall linux?
don't get defensive.
habitual is trying to help you, and their gentle critique is justified:
if you are so new to linux, what were you doing trying to change your sudoers file? and why weren't you using visudo for that, as every tutorial says?
ok, try this:
Code:
sudo chown -R root:root /etc
and reboot.
if that helps, lucky.
if not, and judging from your admission that you are clueless, i think your best bet is to boot up a live distro, copy whatever files you want to save to a spare usb stick, and reinstall.
and chalk it up to experience: be more careful in future. don't execute a command without knowing what it does.
and it has happened to all of us at some point!
Well I'm VERY new to linux and had no idea that /etc was system files. Mostly because of what it was named. I just figured it was random information for installed programs.]
For future reference, whatever the task, if you need root privileges in order to do it, then you need to take a long hard look at what you're doing and why. If it was just "random information" that didn't matter, you wouldn't need to be root.
Quote:
Originally Posted by MrPork
Also, I have no idea what you just told me to do. Is there a way to back up my files and reinstall linux?
Sure, either way you'll want to boot into a live distro so you have permission to mount drives, etc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.