Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
02-06-2007, 11:13 AM
|
#1
|
Member
Registered: Dec 2004
Location: Atlanta, GA U.S.
Distribution: I play with them all :-)
Posts: 316
Rep:
|
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
|
|
|
02-06-2007, 11:52 AM
|
#2
|
Member
Registered: Sep 2006
Distribution: Windows .. MUAHAHAHA
Posts: 66
Rep:
|
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
|
|
|
02-06-2007, 11:56 AM
|
#3
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
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
|
|
|
|
02-06-2007, 06:23 PM
|
#4
|
Member
Registered: Dec 2004
Location: Atlanta, GA U.S.
Distribution: I play with them all :-)
Posts: 316
Original Poster
Rep:
|
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
|
|
|
02-07-2007, 08:13 AM
|
#5
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 07:58 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|