LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-16-2002, 02:00 PM   #1
macgyver
LQ Newbie
 
Registered: Apr 2002
Distribution: Red Hat, Mandrake
Posts: 6

Rep: Reputation: 0
different umask for different user


I have this profile script right now...

#/etc/profile

if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then
umask 002
else
umask 022
fi

How do I make it so that user "mm4" has a umask of 002 without messing up the original security permissions? Rigth now every file that is created within mm4's directory has permissions of 600 and I need them to be 775. Thanks
 
Old 04-16-2002, 04:09 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,383
Blog Entries: 55

Rep: Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558
Re: different umask for different user

if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then
umask 002
elif [ "$(id -un)" = "mm4" ]; then
umask 002

else
umask 022
fi
 
Old 04-16-2002, 04:16 PM   #3
macgyver
LQ Newbie
 
Registered: Apr 2002
Distribution: Red Hat, Mandrake
Posts: 6

Original Poster
Rep: Reputation: 0
thanks alot man
 
Old 04-16-2002, 04:23 PM   #4
macgyver
LQ Newbie
 
Registered: Apr 2002
Distribution: Red Hat, Mandrake
Posts: 6

Original Poster
Rep: Reputation: 0
after I edit it, how do the changes take effect? do i need to restart??
 
Old 04-17-2002, 01:24 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,383
Blog Entries: 55

Rep: Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558
just login again.
 
Old 04-17-2002, 09:09 AM   #6
macgyver
LQ Newbie
 
Registered: Apr 2002
Distribution: Red Hat, Mandrake
Posts: 6

Original Poster
Rep: Reputation: 0
Okay, maybe I was dealing with the wrong thing. I don't really log in. The web server is running all the time and there is a folder (users/mm4) that whenever files are put in it or created in it by software running on the server, their default permission is 600. I called the software company and they said it was cause my default permissions for that folder were set to 600 so anything created in there would have those permissions. Thats when I thought it was a umask issue but I guess I was wrong. How do I set default permissions for a certain folder??
 
Old 04-17-2002, 11:33 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,383
Blog Entries: 55

Rep: Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558Reputation: 3558
Umasks aren't given to dirs, but to users and groups.

Simple example: umask 077; mkdir TEST: TEST would be created with rights 700. Now
umask 002; touch TEST/test; ls -al TEST.
Now it'll return permissions as 0664 on TEST/test, because the user mask is now 002, even tho the dir's permissions where set to 0700.

So you could set the user mask to 007 if you would allow default file creation to be set to user and group read-write and world none. *Note this doesn't prevent manual chmodding it to 0777 by user or group members.

HTH somehow
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Umask Randvegeta Linux - Software 3 11-27-2009 07:52 AM
Set umask for user in KDE jferrando Linux - Security 2 01-12-2005 10:41 AM
umask for a user super-momo Debian 5 06-27-2004 01:15 PM
umask trophy Linux - General 1 04-03-2004 01:17 AM
Umask def1014 Linux - Security 3 06-21-2002 04:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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

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