Peppermint | Linux OS Community Forum
 
It is currently Sat Dec 16, 2017 10:24 pm

All times are UTC - 5 hours [ DST ]





Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: "Fixing" file permissions in Home (SOLVED/SOLUTION POSTED)
PostPosted: Thu Aug 12, 2010 1:03 am 
Offline
User avatar

Joined: Tue May 25, 2010 6:31 pm
Posts: 20
Location: Connecticut, USA
Class: Post-install fix
Difficulty: Moderately advanced; bulk permissions and ownership changes using bash
Time: Not long, depends somewhat on complexity of file structure in /home
Desirability: Sanitizes unusual file permissions set on certain file systems

"Editor"'s note: This was contributed by PixelPlane, and is a rather handy if sorta brutal fix for the problem of Windows permissions being sort of, well, idiosyncratic. As the OP recommends, do not use this outside of your home folder, and do not be root when doing it in any case. Bad things will happen if you start messing with permissions in the root file system.

Okay, long story short....I copied my user files over to my home folder from windows and then copied them back after a reinstallation. However, the files retain an "Allow read/write" for ALL users, as well as having execution permissions. Now I have alot of files, and while the permissions option in right click preferences works fairly well, I can't change the execution permissions enmasse while directories are selected. I know that chmod should allow me to do something fairly easy to correct (I'd prefer permissions where other users could NOT read my files at all...but for the life of me I can't figure out this mess of umask, etc that has occured with ubuntu). the permissions. Anyone have a command that would allow me to fix these permissions.

And perhaps, If possible, and if anyone knows enough, is there also an easier explanation as to how to change the permissions settings for the entire system so that newly created files have permissions "User- Read/Write Group- Read Others- None" (my understanding is this would be umask 0027)? And maybe a command to update my permissions properly. I can't seem to find an easy to understand tutorial for how to do this. I usually just find a jumbled mess of "umask or this or that or this that" @3@

--------------

EDIT: Alright, found a really good explanation of umask and some of chmod, as I mentioned, right here: http://teaching.idallen.com/dat2330/06w/notes/umask.txt

As for my problem, I'll be marking this as "solved" as I can at least get my system to where it would be "correct" according to Ubuntu's current umask (which I actually heard will be changing come Maverick). It was a command I found posted for a similar problem.

The command uses find, and is rather quite simple. Well actually it's two commands that need to be run one after another. Now I know my second problem with umask is still present (although I'll ignore it, as Maverick's blueprints has the fix I'm looking for), this should "fix" your file permissions in your home directory (Or your directory of choice) back to "Normal" for ubuntu.


Run the following to use find to locate each "file" in your current directory, and any files within directories within that directory (and so forth) and perform the chmod 644 (permissions rw-r--r--) on all files found:
Code:
find $DIRNAME -type f -exec chmod 644 {} \;


Then run the following to use find to locate each "directory" in your current directory, and any directories within that directory (and so forth) and perform the chmod 755 (permissions rwxr-xr-x) on all directories found (execution permission is required for directories, otherwise you won't be able to view the contents of that directory):
Code:
find $DIRNAME -type d -exec chmod 755 {} \;


This will give your directories and files the permissions ubuntu would give them according to it's umask setting of 0022. Now I will go and recommend this bit of advice...DON'T USE THIS OUTSIDE YOUR HOME DIRECTORY. I have no idea if it will cause a negative effect on anything root owned (shouldn't without using sudo along with the command...), but I wasn't willing to find out for myself and neither should any of you.

_________________
Current OS: Peppermint Two x64
--
Also, I'm a member of the furry fandom who attends Anthrocon and Furfright...what? o3o


Top
 Profile  
 
 

Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

Powered by php B.B. © 2000, 2002, 2005, 2007 php B.B. Group
Template made by DEVPPL