LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 08-21-2011, 12:33 PM   #1
lotsofquestions
LQ Newbie
 
Registered: Aug 2011
Posts: 3

Rep: Reputation: Disabled
Changing default umask


Hi I'm trying to set the default umask in several different ways on ubuntu 11.04

"There are no umask entries in /etc/init.d/rcS"

Can somebody please tell me what to put in /etc/init.d/rcS to set the umask to 077?


"There is no default umask settings for user login shells
in /etc/login.defs"

Can somebody please tell me what to put in /etc/login.defs to set the default umask to 077?


And can somebody please tell me how to set the default umask to 077 in
/etc/bashrc and /etc/profile

I want to set it in both to be safe, but I don't know what to put in the files to set the default to 077.

Any help with this would be appreciated!
 
Old 08-21-2011, 01:14 PM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Do you have a file /etc/login.defs in Ubuntu? If so, you'll find it in there. It will (or should) look like
Code:
# Default initial "umask" value.
# UMASK is also used by useradd and newusers to set the mode of new home
# directories.
# 022 is the default value, but 027, or even 077, could be considered
# better for privacy. There is no One True Answer here: each sysadmin
# must make up her mind.
UMASK           022
If it's not there, try entering the above (and, of course, changing 022 to 077.

While I'm thinking about it, you could simply set it in /etc/profile with
Code:
export UMASK=077
Although that's a little overkill (you do it in /etc/profile to be sure you set the value in all shells -- bear in mind, however, that an individual user can override that setting in their own ~/.profile).

If that doesn't work, try (as root or sudo) to find the actual setting
Code:
cd /etc
find . -type f -print | grep -i umask
Hope this helps some.

Last edited by tronayne; 08-21-2011 at 05:19 PM. Reason: Clarification
 
  


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
How Set Default Umask Ani Slackware 5 01-05-2024 01:56 AM
umask and default file permission cool9292 Linux - Newbie 2 03-10-2006 07:03 PM
Umask and Linux Default Permissions Sandoomaphone Linux - Security 9 08-23-2004 04:48 PM
can you set a default umask for only certain directories? BrianK Linux - General 3 06-14-2004 09:02 PM
Changing umask RHG Linux - Networking 2 10-20-2003 02:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 03:45 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
Open Source Consulting | Domain Registration