Permissions Problem With Folders And Files In LM7

Permissions Problem With Folders And Files In LM7

Postby Hawkeye_52 on Mon Jun 08, 2009 1:35 pm

I am a fairly new convert to the Gnome desktop, so there may be a very simple answer to this question (e. g. some step I am missing or a file or library that needs to be installed), but my problem is assigning appropriate permissions to folders and files, with the utility provided when I access them.

Let's say I want to do something to the 'Documents' folder. I right click on the folder and I have a menu available in a 'pop-up' window. At the bottom of the long list of options is 'Preferences' -- I select that and another pop up window appears with tabs along the top. One of those tabs is titled 'Permissions'. I select the tab for Permissions, and I may alter, depending on my level of authority, listed Owners (e. g. individual 'Owner', 'Group', and 'Others'. In each category, there are choices for 'Folder Access', 'File Access', ability to 'Execute' as a program, and finally a button that says 'Apply Permissions to Enclosed Files'. My problem is that when I select that last button option, and then go into the folder, none of the changes I have selected are 'inherited' by the files within the folder. In a folder that contains a lot of files, this is a real bummer.

I have tried making these changes as a normal user, and as one with 'Root' privileges. It doesn't matter -- the enclosed files do not inherit the permissions I have granted on the pop-up menu.

I hope I have been clear, because I sure would to get this really great feature to work. I am sure there may be some command line statements that would help (chmod, chgrp ?), but I have no idea how I would use the command line to designate the 'execute' aspect of this menu.

Looking forward to any help and/or directions as I wander in the wilderness of permissions :( (sounding as poetic as a confused noobie can be...)

Thanks

Hawkeye
User avatar
Hawkeye_52
Level 3
Level 3
 
Posts: 148
Joined: Thu Mar 06, 2008 5:06 am
Location: USA

Linux Mint is funded by ads and donations.
 

Re: Permissions Problem With Folders And Files In LM7

Postby Husse on Tue Jun 09, 2009 12:25 pm

I have just tried (albeit only with one file :)) and it works (Gloria main)
Avoid changing permissions and particularly avoid doing it as root in your home folder - you don't want root to own files there...
Which Mint do you have?
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19710
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Permissions Problem With Folders And Files In LM7

Postby Hawkeye_52 on Tue Jun 09, 2009 1:49 pm

Husse wrote:I have just tried (albeit only with one file :)) and it works (Gloria main)
Avoid changing permissions and particularly avoid doing it as root in your home folder - you don't want root to own files there...
Which Mint do you have?

Husse,

I think you have just pointed me in the direction of my error, although I am not sure how to handle your solution.

First, I am using Linux Mint 7 (e. g. Gloria main). I have been trying to do this while in my user account, but I have put a 'menu option' under 'Applications', 'System Tools' called 'Root File Browser'. I accomplished this by putting a new launcher and then activating it with the command 'gksu /usr/bin/nautilus'. It is in this mode that I have experienced the problem described. Is this the problem? If so, what is my fix?

BTW, it's nice to have one of the 'big guns' giving me a hand. You tried to help me last time, with my ATI problems. Do they let you sleep any?

Look forward to hearing from you.

Hawkeye
User avatar
Hawkeye_52
Level 3
Level 3
 
Posts: 148
Joined: Thu Mar 06, 2008 5:06 am
Location: USA

Re: Permissions Problem With Folders And Files In LM7

Postby Husse on Tue Jun 09, 2009 5:10 pm

Not quite sure if I get you right -
'menu option' under 'Applications', 'System Tools' called 'Root File Browser'.

By default you can right click in any folder and select "open as root" so I don't see the need for it
But if you set permissions here you could easily make root the owner by mistake
And certainly this could be a problem with "the owner" as the folder but not the files in it are owned by root
But I have experimented with this and can't replicate it regardless of if the folder is owned by root or me
But I have not tried your menu option - I should have some virtual systems to play with
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19710
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Permissions Problem With Folders And Files In LM7

Postby Hawkeye_52 on Tue Jun 09, 2009 10:55 pm

Husse,

Just for fun and chuckles, I tried the method you mentioned with the 'Open As Root' option in the normal Nautilus browser. Inside my home directory I have the 'normal' folders available to me -- can't remember whether Linux Mint has one named 'Downloads' by default or whether I added it, but the 'Downloads' folder is definitely under my permissions. However, inside my 'Downloads' folder, I have another folder named 'Faces', with a bunch of GDM/KDM faces that I carry around to whatever my primary distro is. That 'Faces' folder began as a 'Root' permissioned folder, and all the 100+ .png images inherited the 'Root' permission.

Having tried to change the permissions en masse the way I explained earlier, I entered this time through the normal user method, and right clicked on the 'Faces' folder, selecting 'Open As Root'. When presented with the pop-up menu, I went to Preferences, changed all the permissions to normal user (e. g. Hawkeye), and then hit the button 'Apply Permissions To Enclosed Files'. Upon entering the 'Faces' folder, all the individual *.png images still were designated with 'Root' permissions.

I have trouble believing that I have installed a 'bad burn' .iso, because everything else performs so well (ATI card excluded, of course). I am at a lost on where to go with this, and have resorted to merrily changing a few of the images manually each day (it takes about 5 or 6 mouse movements for each .png file) and accept that this is just an onerous task that will cost me a couple of hours, spread over a few days.

Ah well, life in the big city.

Thanks for looking into it for me....

Hawkeye
User avatar
Hawkeye_52
Level 3
Level 3
 
Posts: 148
Joined: Thu Mar 06, 2008 5:06 am
Location: USA

Re: Permissions Problem With Folders And Files In LM7

Postby Fred on Tue Jun 09, 2009 11:01 pm

Hawkeye_52,

File and folder permissions are one of the more important differences between Windows and Linux. In Linux's world, the file system is everything. If it isn't part of the file system, it doesn't exist and can't be manipulated, recognized, or used in any way. Controlling who and what can be done with a file then becomes a powerful means of enabling or disabling system functionality and access.

Any discussion of permissions on Linux can become rather complicated, rather quickly. It is rare to actually need to change file and folder permissions from the defaults, especially so outside of your /home. If you have concluded you need to do that, warning bells should sound and red flags should go up. Doing so can easily render your system non-functional or at best compromise your securiety. My first question to a new user about to change file and folder permissions would be, "Why do you think you need to change permissions from the default?" In many/most cases, especially when done outside your /home, you stand a good chance of adding another problem as opposed to solving your existing problem.

Having said that, there are times when it is necessary and/or desirable to adjust some specific permissions. Almost all your GUI file management programs offer some ability to adjust permissions. Unfortunately, I have found most to be limited and somewhat unreliable/inconsistent, depending on the distro, GUI program, and exact situation.

I prefer to do this from the CLI, (Command Line Interface), as it is more precise and reliable, as well as being universal across all the distro variations. There are two ways of doing it from the CLI, one text, the other numerical. I prefer the numerical method, though one is as good as the other, so that is what I will use for most of the examples below.

First ownership. This is an important setting, as it determines who owns and therefore controls the file/folder. We use the "chown" command for this. Changing/setting ownership requires root privileges. Example for a folder:

sudo chown -R fred:fredgrp /home/fred/Data

sudo gives us root privileges.
chown is the ownership command.
-R is the recursive option, to set the entire folder tree the same way.
fred:fredgrp is the owner and group to be set.
/home/fred/Data is the path to the folder tree we are setting.

As you can see, it is a straight forward terminal command that shouldn't be too difficult to learn and retain, if you aren't the note taker type. :-)

If all you need to do is set the file to execute, perhaps for a script you downloaded from a highly trusted source. And you don't want to take a chance on changing anything else, use the "chmod" command below. Again, root privileges are required:

sudo chmod +x /usr/local/puresex.sh

sudo gives us root privileges.
chmod is the command for setting permissions.
+x adds the execute bit.
/usr/local/puresex.sh is the path and file to set to execute.

Again, a pretty straight forward terminal command.

Now we get a bit more complicated. There is a bit that we will ignore in this discussion that is for SGID, SUID, and sticky bit that you would almost never use. If you want to know more about it you can Google it. But for now we will always set it, the first bit, to "0".

For each file/folder we can set read, write, and execute privileges for the owner, the group, and others. We can do this with a simple numerical formula and add the columns to get the right numerical value to use in the "chmod" command. The advantage to this method is it is less error prone, believe it or not. You are not as likely to forget something or get confused with the repetitive text, -, and +. Read has a value of 4. Write has a value of 2. And execute has a value of 1. The three columns are Owner, Group, and Others. I know I have you totally confused. Rather than try to draw a table demonstrating this I want to refer you to the url below. There is a handy table/calculator there that I am sure will clear it all up for you. Just look at it and click the permissions you want for each type of user and you will see how the values are tallied up. Try a few combinations to see how it works. If you can do simple addition, or even if you can't, you are home free. :-)

http://www.onlineconversion.com/html_ch ... ulator.htm

Example of the "chmod" permission setting command:

sudo chmod -R 0600 /home/fred/Data

The first "0" is the sticky bit I talked about above. Can you figure out what permissions I just set recursively for my Data folder tree in my /home?

Good luck. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Permissions Problem With Folders And Files In LM7

Postby Husse on Wed Jun 10, 2009 6:33 am

Do like Fred explains (he is the man when it comes to things like this)
I think the core of your problems is this
That 'Faces' folder began as a 'Root' permissioned folder, and all the 100+ .png images inherited the 'Root' permission.

This means that you have to have root permissions on every file to change it and that may not be inherited
I did not try on an enclosed file owned by root
So sudo chmod -R 0660 /home/Hawkeye/Faces is the solution
We tend to get stuck on what we currently do and not look outside the box :)
Oh - just a note case is important -r and -R can be two completely different things, but I think chmod only has -R
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19710
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Permissions Problem With Folders And Files In LM7

Postby Hawkeye_52 on Fri Jun 12, 2009 3:28 pm

Fred & Husse,

I may not have been clear in the beginning (a common problem of mine :oops: ), but I wanted to know if there was something I was doing wrong to use the portion of the 'Properties' pop-up menu in terms of the 'inherit' button at the bottom. What I have gathered is that either 1> this feature will only work in certain situations (even though I haven't been able to get it to function at all), or 2> there is a bug in the routines that doesn't allow it to run as intended.

Fred, I love to read your posts in the forums. Knowledgeable, precise, and (often) humorous. The 'execute' script is something I am going to tuck away in my diddy bag. I know it will prove useful in the future, and something with 'puresex' in it has got to be worth saving! The link to the permissions calculator was also great -- it adds that 'measure twice, cut once' idea to an important action.

All in all, I was able to get done what I needed to do, I'm just more of a lazy GUI guy, than a command line wizard. But I have just learned I have a greater problem lurking, that may or may not have contributed to the differing results you (Husse) and I experienced using the 'Properties', 'Permissions' utilities in Nautilus. I started to get some graphics anomalies (e. g. distorted or overly wide lines, as well as slow refresh rates), so I pulled out Parted Magic 4.1 and did some diagnostic work. Based on the results, I have called in Father Linux to do last rites on my hard drive -- well not last rites exactly, more like last confession. I am waiting for son #2 to come over and install my new Western Digital (320 GB, 7,200 RPM SATA :mrgreen: ).

Once my desktop is healthy again, if my results change in using these utilities, I will post back. Otherwise, thanks for all the help, advice, and useful knowledge....

Hawkeye
User avatar
Hawkeye_52
Level 3
Level 3
 
Posts: 148
Joined: Thu Mar 06, 2008 5:06 am
Location: USA

Re: Permissions Problem With Folders And Files In LM7

Postby altair4 on Fri Jun 12, 2009 4:32 pm

but I wanted to know if there was something I was doing wrong to use the portion of the 'Properties' pop-up menu in terms of the 'inherit' button at the bottom

You're not doing anything wrong. It doesn't work - it's a bug - it's been a bug since November 26, 2007
https://bugs.launchpad.net/ubuntu/+sour ... bug/165113
https://bugs.launchpad.net/ubuntu/+sour ... bug/302628

Based on this comment at http://brainstorm.ubuntu.com/idea/2260/ I wouldn't bet on it getting fixed:
Idea2260.png
Idea2260.png (8.46 KiB) Viewed 3103 times


If that is their attitude then get rid of the option because right now it could confuse someone's father :wink:
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5804
Joined: Tue Feb 03, 2009 10:27 am

Re: Permissions Problem With Folders And Files In LM7

Postby altair4 on Fri Jun 12, 2009 4:51 pm

And another thing, I wish these pups would stop referring to their mothers as dolts. My wife is old enough to be the mother of some of the more junior software developers and she is a Senior Application Software Architect. She doesn't get confused often .

I had to get that off my chest :evil: - Sorry about that .
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5804
Joined: Tue Feb 03, 2009 10:27 am

Re: Permissions Problem With Folders And Files In LM7

Postby Husse on Fri Jun 12, 2009 5:56 pm

altair4 - I completely agree with what you say about mothers
On a sidenote I'm rather irritated on myself for not finding that bug report
On a second sidenote it actually worked on two files for me
On a third sidnote :) - yes executing a -rf command can be dangerous whether in the terminal or in a GUI
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19710
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Permissions Problem With Folders And Files In LM7

Postby Fred on Fri Jun 12, 2009 9:53 pm

altair4,

I was an RN in another, much earlier life. Maybe I can lend some insight into your pet peeve. There is a fairly common imbalance, in male youngsters especially, that results in excessive levels of testosterone. Even though it hasn't been proven as a medical certainty, excessive testosterone levels have been strongly linked to "loose tongue disease" as well as an unspellable condition, especially by the victims, which causes significant limitations on the functionality of available gray matter.

Even though either of these conditions can be terminal, they seldom are, especially if the condition is diagnosed early and an appropriate treatment regimen is put into place. Depending on the severity of the condition, a full recovery can usually be expected by administering one or more multi-part courses of "real life." A few continuing education classes at the "University of Hard Knocks" has been shown to have therapeutic value and a rehabilitative effect as well.

Fear not, this too shall pass. All will be well with them given the passage of a little time. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Permissions Problem With Folders And Files In LM7

Postby altair4 on Sat Jun 13, 2009 8:23 am

Husse wrote:altair4 - I completely agree with what you say about mothers
On a sidenote I'm rather irritated on myself for not finding that bug report
On a second sidenote it actually worked on two files for me
On a third sidnote :) - yes executing a -rf command can be dangerous whether in the terminal or in a GUI


In reviewing my initial posting in this topic I realized that it sounded as though it was a Mint bug that has gone unresolved. That was not my intent and I apologize. This is clearly an ubuntu bug or even more likely a gnome bug. Also, it has worked for me as well but not dependably which is why I always use the command line when I need to do this ( which is very rare ).

To Fred;
I did not realize that there was actual clinical evidence of this condition. I appreciate your insight. :lol:
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5804
Joined: Tue Feb 03, 2009 10:27 am

Re: Permissions Problem With Folders And Files In LM7

Postby Fred on Sat Jun 13, 2009 8:46 am

altair4,

I just thought your wife especially might get a smile out of that one. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Linux Mint is funded by ads and donations.
 

Return to MATE

Who is online

Users browsing this forum: No registered users and 7 guests