LinuxQuestions.org
Help answer threads with 0 replies.
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 02-06-2007, 11:13 AM   #1
Harlin
Member
 
Registered: Dec 2004
Location: Atlanta, GA U.S.
Distribution: I play with them all :-)
Posts: 316

Rep: Reputation: 38
Changing Default File/Directory Modes


I have a user when he creates a directory, the directory is given a 755 mode (User: Read,Write,Execute; Group:Read, Execute; Others:Read, Execute). How can I set this up so that when a user creates a file/directory it is given a 775 mode?

Thanks,

Harlin Seritt
 
Old 02-06-2007, 11:52 AM   #2
MOS JEFF-INITELY
Member
 
Registered: Sep 2006
Distribution: Windows .. MUAHAHAHA
Posts: 66

Rep: Reputation: 15
the command `umask` is used to set default values for your file permissions when the files are created. `umask 002` is the command to change the default permissions to 775 when the file is created.

ease-e
 
Old 02-06-2007, 11:56 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Add this line in ~/.bash_profile:
umask 002

If you want this automatic for new users, put it in /etc/login.defs:

Quote:
Originally Posted by /etc/login.defs
# UMASK usage is discouraged because it catches only some classes of user
# entries to system, in fact only those made through login(1), while setting
# umask in shell rc file will catch also logins through su, cron, ssh etc.
#
# At the same time, using shell rc to set umask won't catch entries which use
# non-shell executables in place of login shell, like /usr/sbin/pppd for "ppp"
# user and alike.
#
# Therefore the use of pam_umask is recommended (Debian package libpam-umask)
# as the solution which catches all these cases on PAM-enabled systems.
#
# This avoids the confusion created by having the umask set
# in two different places -- in login.defs and shell rc files (i.e.
# /etc/profile).
#
# For discussion, see #314539 and #248150 as well as the thread starting at
# http://lists.debian.org/debian-devel.../msg01598.html
#
# Prefix these values with "0" to get octal, "0x" to get hexadecimal.
#
ERASECHAR 0177
KILLCHAR 025
# 022 is the "historical" value in Debian for UMASK when it was used
# 027, or even 077, could be considered better for privacy
# There is no One True Answer here : each sysadmin must make up his/her
# mind.
#UMASK 022
 
Old 02-06-2007, 06:23 PM   #4
Harlin
Member
 
Registered: Dec 2004
Location: Atlanta, GA U.S.
Distribution: I play with them all :-)
Posts: 316

Original Poster
Rep: Reputation: 38
Hi NX,

Thanks for the help on this :-)!!! One thing though I did want to ask is how can i specify this only for a certain user(s)?

Anyways, thanks for the help -- this is a life saver.

Harlin Seritt
 
Old 02-07-2007, 08:13 AM   #5
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
Originally Posted by Harlin
Hi NX,

Thanks for the help on this :-)!!! One thing though I did want to ask is how can i specify this only for a certain user(s)?
You're welcome :-)
Its the first line, put it in $HOME/.bash_profile of the user you want it to be affected.

For pam, I never tried it.
 
  


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
Changing Sendmail's default mail storage directory?? RKris Linux - General 4 07-15-2015 12:46 PM
Changing default terminal login directory mareid Linux - General 1 06-17-2006 11:31 PM
Changing default current directory to / when ftp ckit Linux - Newbie 1 01-27-2004 08:34 PM
changing Up2date default installation directory ! mchenrytl Red Hat 1 09-25-2003 08:27 AM
Changing default directory / vsftpd chrisknight Linux - Software 5 03-27-2003 07:16 AM

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

All times are GMT -5. The time now is 07:58 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