LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-13-2009, 11:19 AM   #1
Ani
LQ Newbie
 
Registered: Oct 2002
Posts: 27

Rep: Reputation: 0
How Set Default Umask


How do you set the default Umask setting for all users on the computer in Slackware?

I tried to change it in /etc/profile but it did not change for root or other users.
root is using /bin/bash and all other users are using /bin/false so they do not have a local .profile.

The other users are using the chroot option in openssh5.2 and thus using the "ForceCommand internal-sftp" option.
Anyone know what shell the internal-sftp is using?

I don't see a /etc/default/bashrc like on other distros.
 
Old 11-13-2009, 03:02 PM   #2
HaroldWho
Member
 
Registered: Nov 2006
Location: southeastern PA
Distribution: Slackware
Posts: 130

Rep: Reputation: 23
What about 'umask 022' in /etc/rc.d/rc.local

BTW, my /etc/profile contains the following:
Code:
# Default umask.  A umask of 022 prevents new files from being created
# group and world writable.
umask 022
 
Old 11-14-2009, 08:49 AM   #3
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 706
Blog Entries: 1

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
Hi Ani

/etc/login.defs
search for UMASK and change

Regards
Jack
 
Old 01-04-2024, 05:29 PM   #4
rootaccess
Member
 
Registered: Mar 2012
Posts: 311

Rep: Reputation: Disabled
I know this is old but if anyone is wondering, in slackware 15.0, /etc/login.defs has no effect if you change the umask. It must be done in /etc/profile for system-wide affect. then you must reboot
 
Old 01-05-2024, 01:20 AM   #5
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 995

Rep: Reputation: 675Reputation: 675Reputation: 675Reputation: 675Reputation: 675Reputation: 675
Quote:
Originally Posted by rootaccess View Post
It must be done in /etc/profile for system-wide affect. then you must reboot
There is no need to reboot to change the umask. In any shell you can alter the umask and simultaneously run different shells with different umask. You will get the default umask at login, but unfortunately, by default in Slackware most terminal windows are not starting their shells as login shells.

A really good idea is to within the settings of your terminal window choose something called something like "Run command as login shell".
Click image for larger version

Name:	terminal.png
Views:	24
Size:	31.7 KB
ID:	42344
For a terminal like xterm this can instead be choosen by starting xterm with the switch -ls or the X resource "*loginShell: True". For those few terminal programs lacking this setting it is usually instead possible to choose how the shell is started and add the switch -l for the shell.

By default in Slackware you will get a fortune cookie at each login, if you do not see such a fortune cooke at each start of a new terminal window that terminal window might not have been started as a login shell and the files in /etc/profile.d has not been run.

regards Henrik
 
1 members found this post helpful.
Old 01-05-2024, 01:56 AM   #6
Windu
Member
 
Registered: Aug 2021
Distribution: Arch Linux, Debian, Slackware
Posts: 594

Rep: Reputation: Disabled
Quote:
Originally Posted by rootaccess View Post
I know this is old but if anyone is wondering, in slackware 15.0, /etc/login.defs has no effect if you change the umask. It must be done in /etc/profile for system-wide affect. then you must reboot
The man page for login.defs states:
Code:
      UMASK (number)
           The file mode creation mask is initialized to this value. If not
           specified, the mask will be initialized to 022.

           useradd and newusers use this mask to set the mode of the home
           directory they create if HOME_MODE is not set.

           It is also used by pam_umask as the default umask value.
Slackware does not use pam_umask but that's not the point. Why do you think that on Slackware this is not true?
 
  


Reply



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
set default umask to a directory or a group luvlinux2009 Linux - Security 4 09-17-2009 08:54 PM
Set default umask for ssh as non-root WorkingClassHero Linux - Security 2 02-19-2008 10:09 AM
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
Where to set default file permissions (umask)? tredegar Linux - Newbie 14 01-27-2004 05:10 PM

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

All times are GMT -5. The time now is 04:28 PM.

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