LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 01-23-2006, 11:05 AM   #1
Th3James
LQ Newbie
 
Registered: Jul 2005
Location: Sussex, England
Distribution: SUSE 9.3, Ubuntu Breezy
Posts: 14

Rep: Reputation: 0
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
 
Old 01-23-2006, 11:47 AM   #2
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 58
Reboot, the /proc location does not really exist and rebooting will fix your problem.
 
Old 01-23-2006, 11:49 AM   #3
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
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.
 
Old 01-23-2006, 12:08 PM   #4
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
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.
 
Old 01-23-2006, 03:51 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,633
Blog Entries: 4

Rep: Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931Reputation: 3931
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.
 
Old 01-24-2006, 03:24 AM   #6
Th3James
LQ Newbie
 
Registered: Jul 2005
Location: Sussex, England
Distribution: SUSE 9.3, Ubuntu Breezy
Posts: 14

Original Poster
Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
accidentally changed permissions on home folder Cinematography Linux - General 7 05-15-2005 04:32 AM
Need help restoring /var permissions Thiink Slackware 1 02-21-2005 05:36 AM
Help restoring file permissions from a Dump bminish Linux - Newbie 3 12-12-2004 01:34 PM
changed root's shell accidentally frankie_DJ Linux - Newbie 7 09-19-2004 11:28 PM
accidentally deleted files--need help restoring on reiserfs darksarin Linux - General 4 11-23-2003 07:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration