Accidentally changed the permissions of /proc/, help restoring them please
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.
Accidentally changed the permissions of /proc/, help restoring them please
Hi
I have just accidentally changed the permissions of my proc folder with the command
sudo chmod 766 /proc/
this has cause my system monitor 2 stop working in the gnome panel, and im sure there are security risks to this mistake, so how can i restore the former permissions?
proc appears to be 555 and you didn't make the command recursive so it may be as simple as
sudo chmod 555 /proc/
read = 4
Write = 2
Execute = 1
by changing from 5 which is read and execute to 6 with is read and write you removed the ability for programs that are not running as root to cd into the direcrtory. so your system monitor which runs as a regular user is unable to access the proc directory to obtain CPU or Memory info etc..
I would suggest not changing permissions on system directories.. never a good thing.
Do as Lenard says - reboot. /proc is not physical disk space. It's system memory made to look like disk. You write to /proc and you're altering the memory image of your OS. This can be an incredibly powerful thing to do, but also fraught with peril for the uninitiated. You can easily crash your system. However, a simple reboot and you're good to go. You get a fresh start. That's assuming that your writes to /proc didn't hose the system so bad that you corrupted your filesystems. I woudln't expect that a chmod like you did would do any damage that a reboot wouldn't clear.
I'm rather bemused to hear that the permissions of /proc even can be changed... Not entirely happy to hear that, although I haven't verified it (and probably won't).
Anyhow, /proc, /sys are both "virtual" filesystems; they do not actually exist, but are a figment of the kernel's imagination. Anytime you do anything at all in those directories, the kernel is actually the one that serves up the goodies. It simply delivers them to you as "text files" in "directories."
For example, if you did ls /proc right now, you'd see (among other things) a numbered "directory" corresponding to each process that exists on your system right now. Do it again a few moments later and the contents of that "directory" will have changed. Each time you "list the contents of" this "directory," Linux scans its internal process-table and serves up a "directory" for each process that it finds, among other things. There are also a bunch of other settings, which are made to appear as "files" or other "directories."
It happens to be a particularly-elegant way for Linux to serve-up system settings to you. (For example, it allows programs like ps to be completely non-privileged.) But it's not a "real" directory with "real" files in it.
Thanks guys, both changing the permissions back while running, and rebooting solved the problems, as it is indeed a virtual file system.
This explains why the proc/ directory was empty on my second hard drive
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.