The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-16-2006
FredSmith FredSmith is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 88
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!
  #2 (permalink)  
Old 05-16-2006
ranj@chn ranj@chn is offline Forum Advisor  
Playing with Ubuntu Now!
  
 

Join Date: Oct 2005
Location: Chennai
Posts: 365
read this link

see here for explanation.
  #3 (permalink)  
Old 05-16-2006
steweston steweston is offline
Registered User
  
 

Join Date: May 2006
Location: Vancouver, BC
Posts: 11
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
  #4 (permalink)  
Old 05-16-2006
FredSmith FredSmith is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 88
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!
  #5 (permalink)  
Old 05-16-2006
x96riley3 x96riley3 is offline
Registered User
  
 

Join Date: Mar 2006
Location: Nashville
Posts: 79
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
  #6 (permalink)  
Old 05-16-2006
FredSmith FredSmith is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 88
Is there any way to make a file be RWX (777) by default?

It's a requirement for this server, I understand the security issues, they make perfect sense ... but this server is just used by 2 people for development and test and having files be 777 is a requirement unfortunately. I was just wondering if there is a way to make them RWX (777) by default so they don't have to do it manually.

Thanks!
  #7 (permalink)  
Old 05-16-2006
System Shock's Avatar
System Shock System Shock is offline Forum Advisor  
Registered User
  
 

Join Date: May 2006
Location: Tau Ceti V
Posts: 521
Yes, there's a way. Get a windows server.

I am really curious to know what is this "requirement" that asks for every file to be executable.
"I don't want to type chmod +x script.sh every time" is really not a requirement.
Sponsored Links
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:19 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0