LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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
 
LinkBack Search this Thread
Old 01-22-2006, 02:32 PM   #16
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860

Quote:
Originally Posted by linmix
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
        umask 002
else
        umask 022
fi
although it doesn't look a bit like the entry in your /etc/profiles
In a way it does ... strangely enough the Fudora coders seem to think
that some of the daemons will have login shells... that's all this thing
does:
If a user has an ID <100, and his userid and default group go by the
same name, and he logs in, give him a 002 umask(which I find quite odd).
If he's a regular user he is to get 022.


Cheers,
Tink
 
Old 01-22-2006, 03:52 PM   #17
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
SO do you think this would be the file to edit if I were to want different file and directory permissions to be the standard?
 
Old 01-26-2006, 05:43 AM   #18
jkobrien
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507

Rep: Reputation: 30
Why not define mkdir as an alias of, e.g., '/bin/mkdir -m 0755'? This should allow you to have different default permissions for files and directories.

John
 
Old 01-26-2006, 07:07 AM   #19
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
Since I'm the only user of my box I'd never thought of the necessity of implementing default file and directory permissions... the mkdir alias looks like a fine alternative, but will it affect the way nautilus or konqueror (or any other gui that can make directories9 creates new dirs and files?
 
Old 01-26-2006, 08:26 AM   #20
jkobrien
Member
 
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507

Rep: Reputation: 30
Quote:
will it affect the way nautilus or konqueror (or any other gui that can make directories9 creates new dirs and files?
Gosh, I don't know. I'm hazy about which files are read on login and which on starting a shell, and I suppose the answer depends on which file you put the alias in. Suck it and see, I suppose. John

p.s. I suppose not though, as anything that konqueror does will be done as your username, with your permissions, etc.?

Last edited by jkobrien; 01-26-2006 at 08:28 AM.
 
Old 01-26-2006, 01:08 PM   #21
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Quote:
Originally Posted by linmix
Since I'm the only user of my box I'd never thought of the necessity of implementing default file and directory permissions... the mkdir alias looks like a fine alternative, but will it affect the way nautilus or konqueror (or any other gui that can make directories9 creates new dirs and files?
No, it wouldn't. konqueror, nauseous or whichever gooey tool
you choose will use a system-call that knows nothing of your
alias.


Cheers,
Tink
 
Old 01-26-2006, 01:14 PM   #22
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Quote:
Originally Posted by XaViaR
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.
And in a somewhat belated response to the OP ... NO umask will
ever create a FILE with executable default permissions. You can
run a simple test to verify that:
Code:
umasktest.sh 
#!/bin/bash
for i in 0 1 2 3 4 5 6 7;
do 
umask $i$i$i
  echo "umask $i$i$i" >  bah$i
done

Cheers,
Tink
 
Old 01-28-2006, 09:52 AM   #23
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
Quote:
Originally Posted by Tinkster
No, it wouldn't. konqueror, nauseous or whichever gooey tool
you choose will use a system-call that knows nothing of your
alias.


Cheers,
Tink
I take it you don't hold with gnome (?)...

SO the system call would be the permissions file (os in my case maybe the bashrc) file specifications as implemented by the umask call. Am I right in supposing that if told nothing the system would make 777 files and directories and the permissions entry modifies that to whatever the system administrator believes suitable?
 
Old 01-28-2006, 07:54 PM   #24
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Quote:
Originally Posted by linmix
I take it you don't hold with gnome (?)...
Yep, got that right. I'm not a big fan of convoluted gooeys,
and as far as the DEs go I'd prefer KDE if I had to choose one.
I use fluxbox exclusively, and find filemanagers in general a menace ;}


Quote:
Originally Posted by linmix
SO the system call would be the permissions file (os in my case maybe the bashrc) file specifications as implemented by the umask call. Am I right in supposing that if told nothing the system would make 777 files and directories and the permissions entry modifies that to whatever the system administrator believes suitable?
There's no default I'm aware of, but then I've never come across
a distro that didn't set umask somewhere in the boot-process.

Feel free to edit your boot-script and experiment ;}


Cheers,
Tink
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how create a folder/permission rusmi Linux - Newbie 7 02-11-2005 10:04 AM
Permission to write to folder Garoth Linux - Software 1 10-09-2004 11:41 PM
Folder permission javamdk Slackware 9 07-07-2004 11:26 AM
how can i default the max folder file size when it create inside a folder antony_csf Linux - Software 1 06-17-2004 02:26 AM
File, Folder permission and SAMBA Steve1445 Linux - Newbie 2 01-15-2004 02:13 PM


All times are GMT -5. The time now is 01:34 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration