The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!


Other UNIX.COM Threads You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
changing /cn@0:console file permissions ErnieG Security 4 12-04-2007 04:39 AM
changing permissions on a 444 file (ie chmod 444) ajcannon UNIX for Dummies Questions & Answers 1 08-31-2007 07:48 AM
changing default file permissions FredSmith UNIX for Dummies Questions & Answers 8 12-27-2005 10:16 AM
Changing file permissions on upload guix UNIX for Advanced & Expert Users 6 07-13-2004 01:37 PM
changing file permissions gagansharma Shell Programming and Scripting 0 11-27-2001 07:26 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-16-2006
Registered User
 

Join Date: Sep 2005
Posts: 85
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Changing file permissions

Is there a way to change a unix user's default file permissions so that when he creates a file, by default permissions are 777???

Thanks!
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-16-2006
Playing with Ubuntu Now!
 

Join Date: Oct 2005
Location: Chennai
Posts: 363
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
read this link

see here for explanation.
Reply With Quote
  #3 (permalink)  
Old 05-16-2006
Registered User
 

Join Date: May 2006
Location: Vancouver, BC
Posts: 11
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
umask

Fred,

Look at the man page for the 'umask' command.

Careful - the umask command works to REMOVE permissions from the user's default, rather than add them.

More generally, this will acheive what you need, but consider the security implications of setting the user's default file creation permissions to 777 before you proceed.

Steve
Reply With Quote
  #4 (permalink)  
Old 05-16-2006
Registered User
 

Join Date: Sep 2005
Posts: 85
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
why not execute privs?

I set umask ugo=rwx for a test user.

I then vi a test file (tree). When it's created it's not getting X, just RW.

"tree" [New file] 1 line, 5 characters
$ ls -ltr
total 672
-rw-rw-r-- 1 root sys 5296 Apr 3 06:33 ps_data
-rw-r--r-- 1 root other 5 Apr 25 12:41 speckeysd.lock
-rw------- 1 root other 310984 Apr 25 12:41 dtdbcache_:0
-rw-r--r-- 1 root other 0 Apr 25 12:41 sdtvolcheck3076
drwx------ 3 root root 244 Apr 25 12:42 smc898
-rw-rw-rw- 1 rallen cdsweb 5 May 16 12:46 tree
$ umask
00
$


When I create a file it has RW for UGO, but not X. Why isn't execute being set for UGO?

Thanks!
Reply With Quote
  #5 (permalink)  
Old 05-16-2006
Registered User
 

Join Date: Mar 2006
Location: Nashville
Posts: 77
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Files get created by Unix as 666. Then the umask get's applied. So the maximum file creation can only be -rw-rw-rw (666) minus the umask. If 000 is the umask then nothing changes. If the umask is 777, then the file becomes ----------.

It's kind of a nice feature to have files that get created as not executable. Why? Think of a virus. Think of an exe in windows. You get sent and exe in windows and it runs, period. The cool thing about unix and linux is that the virus won't be executable from the start, you have to tell it to become executable. It's really a nice security feature.

-X
Reply With Quote
Google UNIX.COM
Reply



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 09:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102