![]() |
Permission - Folder vs. File
Hello,
I was wondering if it is possible to create folders with default permissions of 0755. And, file permissions with 0744. Is this possible? I know that I can use UMASK 007. However, this will create ALL files/folders with the permission of 0770. Thanks for your help! P.S. I am not using Samba. Just SSH. |
Quote:
Example: Code:
$ umask 022 |
Also umask is a genefral mask, whereas dmask and fmask are masks for directories and files respectively.
|
Thanks for your help!
|
Quote:
|
Quote:
my hands on at the moment, or Solaris? Where do you find dmask/fmask? :) Cheers, Tink |
I read up on mount (man page) and found info on dmask and fmask for inclusion in fstab. Maybe it's a builtin command? Haven't looked if it exists as seperate binary and am not at my linux box right now.
|
Quote:
have *nothing* to do with linux file-system creation masks. Cheers, Tink |
Sorry. I guess that's the risk of answering a post when you have no access to a linux box. I expected that since it works for mount options there would be a binary as well, but it appears I was wrong: umask is a bash builtin command, dmask and fmask only apply to mount options.
Anyway, to get back to the topic at hand, I guess default file and directory permissions are set in a config file somewhere, so if you locate that the question would be answred, right? Does anyone know? |
The common place (for the system default umask) is
/etc/profile - may (of course) vary with distribution, and no, it's a script, not a config-file. Cheers, Tink |
Code:
]$ cat /etc/profileProbably different in Fedora then.. |
As I said - it can vary;
Mine is here: Code:
# /etc/profile: This file contains system-wide defaults used byCheers, Tink |
This is one of the few things that occasionally makes want to scream. I know each distro developer blieves he/she has a very good reason for doing things diferently, but the disparity in config files and scripts between distros - not in content, but in location - can be quite annoying at times.
I suppose I could just include those lines in my /etc/profiles script, but I doubt whether it'll do any good as either my distro won't look into that script for the permissions, or it will override it with the settings indicated somewhere else. Where? Who knows! Annoying!! Mainly becasue it makes learning 'linux' so much harder. |
Well, FCs coders may have stuck it somewhere in /etc/profile.d
for instance... Just do a grep -r umask /etc/* to find where ... Cheers, Tink |
Strange as it may sound I'd never used grep in this way! I either use it to serch for a file by name (as a complement to slocate) or to look inside 1 file, but I do remember reading this...
Anyway, grep -r umask /etc/* gives a ling list of hits, but no profiles. The most promising entry (as far as I can tell) is /etc/bshrc (what's rc an abbreviarion of anyway?) Code:
if [ $UID -gt 99 ] && [ "`id -gn`" = "`id -un`" ]; then |
| All times are GMT -5. The time now is 12:08 PM. |