LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Accidentally changed the permissions of /proc/, help restoring them please (https://www.linuxquestions.org/questions/linux-general-1/accidentally-changed-the-permissions-of-proc-help-restoring-them-please-406981/)

Th3James 01-23-2006 11:05 AM

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?

thanks

James

Lenard 01-23-2006 11:47 AM

Reboot, the /proc location does not really exist and rebooting will fix your problem.

farslayer 01-23-2006 11:49 AM

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.

haertig 01-23-2006 12:08 PM

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.

sundialsvcs 01-23-2006 03:51 PM

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.

Th3James 01-24-2006 03:24 AM

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


All times are GMT -5. The time now is 05:06 PM.