LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem in changing permissions (https://www.linuxquestions.org/questions/linux-newbie-8/problem-in-changing-permissions-4175418071/)

Arjun 07-22-2012 08:21 AM

Problem in changing permissions
 
I want to change the permission of a file in /proc/self called environ

When i change the permission of this file as a root

Quote:

chmod 777 environ
then i gets an error message

Quote:

chmod: changing permissions of `environ': Operation not permitted
Why i am not able to change the permissions ?

Thanks

Mr. Alex 07-22-2012 08:30 AM

/proc is a virtual filesystem. Why do you want to change permissions there?

Randicus Draco Albus 07-22-2012 08:31 AM

First; You may not be entering the proper command. (A mistake in the file path.)
Second; Why do you want to do this? I just checked this file.
Code:

GNOME_KEYRING_PID=405
You want to allow unlimited access to the keyring?

Mr. Alex posted before I did. His virtual file system sheds some light, but I am still confused.

Arjun 07-22-2012 08:33 AM

I am entering the proper command. I am sure

I just want to do it for some testing purpose

Is there any way to do this ?

pixellany 07-22-2012 08:59 AM

You have to have the right permissions on the parent folder before you can change what's inside.

Bad news: diddling with proc can crash your system in a hurry---I hope you have a good reason

snowday 07-22-2012 09:00 AM

Quote:

Originally Posted by Arjun (Post 4735100)
I am entering the proper command. I am sure

I just want to do it for some testing purpose

Is there any way to do this ?

You did it, you know the results of the test (permissions of /proc cannot be changed). :)

In the future, better to understand permissions and Linux file structure before testing (unless you are intentionally trying to break the system to see what will happen).

Mr. Alex 07-22-2012 09:00 AM

http://forums.debian.net/viewtopic.php?f=5&t=46494

Arjun 07-22-2012 09:13 AM

Ok

Thanks for your replies

I thought, as a root i can change the permission of it.

pixellany 07-22-2012 09:44 AM

Quote:

Originally Posted by snowpine (Post 4735114)
You did it, you know the results of the test (permissions of /proc cannot be changed). :)

They can on my system:
Code:

[root@herring_desk /]# ls -l|grep proc
dr-xr-xr-x 208 root root    0 Jul 20 04:56 proc
[root@herring_desk /]# chmod 777 proc
[root@herring_desk /]# ls -l|grep proc
drwxrwxrwx 208 root root    0 Jul 20 04:56 proc

(Yes, I changed it back----No, I don't do this kind of thing....;) )

Mr. Alex 07-22-2012 10:11 AM

Can you change them inside of /proc?

pixellany 07-22-2012 12:44 PM

Yes....

chrism01 07-22-2012 07:42 PM

Given that /proc is basically a window into the kernel, any change will vanish on reboot.
I've heard of people changing content in there, but never ownerships or perms...

bsat 07-23-2012 02:16 AM

You can change the permissions of files under /proc.
OP: If you are trying to change the permissions using sudo, try logging in as root and then change the permissions i.e.
"sudo -i" will change you to root then use chmod and see if you can chnge the permissions.


All times are GMT -5. The time now is 07:16 AM.