![]() |
|
|
|||||||
| 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 |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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! |
| Forum Sponsor | ||
|
|
|
|||
|
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 |
|
|||
|
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! |
|
|||
|
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 |
|||
| Google UNIX.COM |