Ownership question


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Ownership question
# 1  
Old 06-18-2009
Ownership question

Hi there, Complete Newbie here so any help would be so appreciated! Smilie I've set up a test directory and am trying to figure out out how to ensure that all new files will remain owned by the directory owner... not the creator of the file??
# 2  
Old 06-18-2009
Do not allow others to write to the directory:
Code:
chmod 744 mydirectory

7 = owner read write execute
5 = group read execute
5 = other read execute
# 3  
Old 06-18-2009
Hi Jim,
Thanks for quick response! I appreciate it! What I'm tentatively thinking about setting up will allow other users to create files in the directory...but that the ownership remains with the directory owner. Will the command referred above allow this! Thanks so much agaiN!
# 4  
Old 06-18-2009
No... Jim's solution is quite clear only owner has the rights to write in the directory.

Perhaps the only workaround would be using NOT the ownership but the group:

You are the owner and your create a group called bb (in /etc/group...)
You change groupownership using chgrp to your directory
Now the trick is:
Code:
ant:/home/vbe $ mkdir AA;ll -ld AA
drwxrwxr-x   2 vbe        bb             96 Jun 18 17:19 AA
ant:/home/vbe $ chmod 2775 AA;r ll
ll -ld AA
drwxrwsr-x   2 vbe        bb             96 Jun 18 17:19 AA
ant:/home/vbe $

To write in AA you would have to be in group bb, whatever is put AA, the group will be bb
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Ownership changes

I have 2 Linux servers and 1 windows server. One Linux server has an NSF share which points to the windows server. The other Linux server rsyncs any data to the other Linux server containing the windows share. My issue is that everytime the Linux administrator rsync data to the linux server... (12 Replies)
Discussion started by: Lace0047
12 Replies

2. UNIX for Dummies Questions & Answers

Change ownership of a directory

I want to change the ownership of a directory ONLY. my id id1 owns the files under the /mypath/bin but /mypath/bin is owned by id2 If i log into id2 I can't do chown id1 /mypath/bin (1 Reply)
Discussion started by: klarue
1 Replies

3. UNIX for Advanced & Expert Users

retain ownership

Hi, I have a script which transfers files/directories from one HP unix to another HP unix server using SCP but i need to retain ownership of files/folders same as source server my script is as follows cd /sasdata/TR_CNTO328/C0328T07/Dry_Run_1/Macros find . -type d -newer . -exec scp -pr {}... (6 Replies)
Discussion started by: tushar_spatil
6 Replies

4. Shell Programming and Scripting

Get ownership info from LS

Hi, When I do the ls-ld command for example like this: # ls -ld /Applications I get an output like this: drwxrwxr-x+ 114 root admin 3876 18 Aug 14:04 /Applications I need to somehow use sed to put the ownership into a format like this: root:admin So basically remove... (2 Replies)
Discussion started by: pcwiz
2 Replies

5. UNIX for Dummies Questions & Answers

changing ownership?

how would i change ownership of file1 so the user NATE gets ownership of the file? (1 Reply)
Discussion started by: trob
1 Replies

6. Shell Programming and Scripting

Why the cp keeps the original ownership?

I want to copy a file from another user to my owner directory, and want to change the ownership to my account. in jung's directory: -rwxr-xr-x 1 jung smart 23 Dec 1 2005 .runme cp /home/jung/runme . under my directory: -rwxr-xr-x 1 jung smart 23 Dec 1... (1 Reply)
Discussion started by: freelong
1 Replies

7. UNIX for Dummies Questions & Answers

precompressing and ownership

I'm looking for a way to create preprocessed .gz files of static pages to serve up to those browsers that can accept them. I know I can use: gzip -c --best index.html > index.html.gz to create the .gz file _and_ keep the original. What's the proper command line way to run that on each... (2 Replies)
Discussion started by: dheian
2 Replies

8. Shell Programming and Scripting

help regarding file ownership

hi friends,i have a doubt,if there is a file for which i have only read access then is there any way to execute it,plz reply soon (5 Replies)
Discussion started by: amit007
5 Replies

9. UNIX for Dummies Questions & Answers

ownership of files

Hi, While changing ownerships from the root on a server i'm managing, i typed chown -R username:users * and it changed all ownership to username. Can someone tell me if there is someway I can set things back the way they were before? I can't even su username from the root. Am I going to just... (4 Replies)
Discussion started by: szhu
4 Replies

10. Filesystems, Disks and Memory

Preserving Ownership w/tar

I'm trying to make a backup of a directory tree on Solaris 8. I'm doing this with my own ID, not root. The problem I am running into is when I extract the archive, all files are owned by me and the group is my default group. The man page lists this as the default behavior when executed by a... (1 Reply)
Discussion started by: bergerj3
1 Replies
Login or Register to Ask a Question