Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 05-20-2008, 08:51 PM   #1
Registered: Feb 2005
Location: State of Denial
Distribution: (X/K)Ubuntu for desktop/laptop, DSL for old machines, Debian for Servers.
Posts: 36

Rep: Reputation: 15
Question Problem setting umask and default file permissions on ubuntu 7.04 server with xfs

Here is a puzzler....

I have an Ubuntu 7.04 server being used for data collection. It's root file system is an xfs partition. It has a single directory in which all programmers store and share projects. We also have about 140 workstations where many employees need to be able to access and edit the data in this specific directory. Thus, I am trying to set the default file permissions for all files created in this directory to 666. Currently all user created files in the directory have permissions of 664.

I have activated the "sticky bit" on the target directory using:
"chmod 3777 <directory name>"

Given that this server has almost no other use or purpose, I have tried setting the umask to 000 in the global .profile and csh.cshrc files under /etc. However, this appears to have no effect. All files created by users in the directory still have permissions 664.

I even tried removing the sticky bit from the target directory, and running "umask 000" from the command line before touching a test file. It was still created with permissions of 664.

I have confirmed there is no access control list installed on the server.

I am completely baffled as to how and why the default file permissions of 664 are being applied. If anyone has any ideas on how I could track down and override this default file permission, any help would be greatly appreciated.

Last edited by a2brute; 05-20-2008 at 08:52 PM.
Old 05-22-2008, 05:57 AM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
The "x" bit needs to be set for directories to be able to access files inside or cd into it.
Change the permissions to 777. The sticky bit is correct.
sudo chmod ugo=rwxt <directory>

You had also used sgid on the directory. That will cause files created there to inherit the gid of the directory. Is that what you want to do?

The sticky bit as you know protects a file from deletion when another user has write access to the directory. However to fully protect a file from being zeroed or altered by a non-owner, the person who creates the file needs to clear the group and other write bit. If a users umask value is 0022, then that is how the file will be created.

You might be a bit confused what 0664 permissions on a file in the directory means. Creating or deleting a file removes an entry from the directory, which from the kernel's point of view is just a file. So it is the permissions of the directory that determines whether you can create a file in that directory. When I change my umask value to 000 and touch a file in /tmp/, it is created with 666 permissions. The /tmp directory has rwx permissions for everyone and the sticky bit set, the same as the permissions as the directory you want.

Last edited by jschiwal; 05-22-2008 at 06:17 AM.


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
File permissions and default umask bnbguy Linux - Newbie 1 06-25-2007 11:14 AM
Umask and Linux Default Permissions Sandoomaphone Linux - Security 9 08-23-2004 05:48 PM
Where to set default file permissions (umask)? tredegar Linux - Newbie 14 01-27-2004 06:10 PM
default file permissions for web server AZDAVE Linux - Security 3 11-13-2003 04:22 PM
umask and default file create permissions Rgamboa Linux - Newbie 5 05-20-2003 12:03 PM > Forums > Linux Forums > Linux - Server

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration