Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Search Forums:



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-03-2010
Registered User
 

Join Date: Jun 2009
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Dir permissions

Hi All,

I have a script which will be run by another user say user 2 which will create a new dir say dir 4 in my work place and copy certains files from his dir.

/t1/t2/t3/dir4

I want to allow the user to create the dir dir4 and copy the files,but bring the control back to my name say user 1 after it is copied.

No one else should be able to do any action in the dir right after the copy is finished.

How to do this?What folder permissions should i set?
Sponsored Links
    #2  
Old 09-03-2010
Moderator
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 12,191
Thanks: 232
Thanked 1,703 Times in 1,632 Posts
Giving someone permission to create directories in your workspace would give them access to delete files in your workspace too. I'd create a directory inside your workspace to give him access to instead, with 2770 permissions, belonging to a group that only you and this user belong to. You will both have access to create and delete files in this directory but he won't have write access to the rest of your workspace, and everything created in it will belong to the same group as the directory because it's set g+s.

Make sure he sets his umask 0007 in order to make files and directories he creates group-writable.
Sponsored Links
    #3  
Old 09-03-2010
Resident BOFH
 

Join Date: Dec 2007
Posts: 1,100
Thanks: 2
Thanked 76 Times in 74 Posts
Quote:
Originally Posted by Corona688 View Post
Giving someone permission to create directories in your workspace would give them access to delete files in your workspace too.
actually this can be avoided with the sticky bit assuming the individual files in the sub directory are not writable by group or other permissions.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
permissions on ftp... aneuryzma UNIX for Dummies Questions & Answers 1 09-03-2009 04:42 AM
To give the "unzip" permissions & "create" file permissions Mike1234 HP-UX 3 03-02-2008 04:34 PM
no permissions DANNYC Forum Support Area for Unregistered Users & Account Problems 1 02-02-2005 06:14 PM
Permissions on /bin josramon UNIX for Advanced & Expert Users 7 04-02-2003 10:50 AM
permissions mma_buc_98 UNIX for Dummies Questions & Answers 1 08-13-2002 05:15 PM



All times are GMT -4. The time now is 04:07 AM.