Change ownership of a directory


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Change ownership of a directory
# 1  
Old 02-28-2013
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
# 2  
Old 03-01-2013
Sorry but on most types of UNIX, you need to be the root user to do that. It's a security feature (directories included).

Imagine a shared environment in, say, a university. You don't like "bob" very much so you create a bunch of dodgy files containing unsavory pictures, bomb recipies and other antisocial things and drop it into /tmp. You then chown to the files to bob and then send an email the head of department Smilie

If it's something you need to routinely do though and it's on the same name files every time, talk to your administrator about being given special rights to run the following command:
sudo chown id1 /mypath/bin
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to set multiple ownership permission on a file/directory?

Hi, Any ideas to set multiple ownership permission on a file/directory on Solaris? I need a folder to have multiple ownership on the 2 nodes servers. The 2 nodes servers require to mount a SMBFS with different user ID. Please assist. Thanks. (6 Replies)
Discussion started by: freshmeat
6 Replies

2. Solaris

User's Home directory ownership is changing Automatically

Hi , on my Solaris 10 machine user's home directory ownership is being changed automatically to their UID. can any one please tell me whats the reason behind it . users are there in /etc/passwd file . /etc/shadow file is also there along with nssswitch.conf file and there is no changes made to... (5 Replies)
Discussion started by: usernew
5 Replies

3. Shell Programming and Scripting

File Ownership Change

Hi, I have several directories under an upload directory where differnt users upload their files (with exxactly the same file name every week) using their own user ids. There is a requirement that once any user uploads the file I have to clean that file and remove extra whitespaces and... (3 Replies)
Discussion started by: vbhonde11
3 Replies

4. UNIX for Dummies Questions & Answers

Ownership of files in bin directory

When I checked to see who or what owns the files in my bin directory I noticed that some were owned by root while many others were owned by bin. Should I be concerned that there are files in this directory owned by bin or is bin the same as root as it pertains to limiting access to the files in... (3 Replies)
Discussion started by: j490428
3 Replies

5. UNIX for Dummies Questions & Answers

recursive directory listing with ownership

i'm playing around with "ls" and "find" and am trying to get a print out of directories, with full path, (recursive) and their ownership.... without files or package contents (Mac .pkg or .mpkg files). I'd like it simply displayed without much/any extraneous info. everything i've tried, and... (5 Replies)
Discussion started by: alternapop
5 Replies

6. Shell Programming and Scripting

To change the ownership at one shot

i have a directory in which i have Multiple files: Following are they==== -rw-r--r-- 1 root root 886 Jan 21 16:38 trunkn.xsd -rw-r--r-- 1 root root 244 Jan 21 16:38 trunknameCache.xml -rw-r--r-- 1 root root 1240 Jan 21 16:38 subscribercache.xsd -rw-r--r-- 1 root ... (1 Reply)
Discussion started by: Aditya.Gurgaon
1 Replies

7. Shell Programming and Scripting

change multiple ownership

Good afternoon, Sir's, i owuld like to search for some advice, whats the fastest way to change multiple files ownership. For HostnameA will be their basis, for what ever files and permissions that hostnameA has, it should replicate the permissions and ownership to hostname B. $hostname... (1 Reply)
Discussion started by: invinzin21
1 Replies

8. UNIX for Dummies Questions & Answers

I am the owner,yet not allowed the change the ownership

sm860 IS the owner of the files below,but yet sm860 cannot change the ownership to bpt3a1.Please let me know why ? See below for details --- sm860@unixs741_DEV:/usr/gdp/home/ftp/bpt3a1/incoming/ahdb/T5/pcasav/daily $ ls -l pcasav* -rw-r--r-- 1 sm860 gdpintegrators 821 Sep 21 16:15... (8 Replies)
Discussion started by: MSHETTY
8 Replies

9. UNIX for Dummies Questions & Answers

copy directory without changing ownership setting

hi currently i am migrating some directories over to a new server. is there any command (rcp or ftp or anything) for me to use without changing the ownership and permission of the directory? i am copying some directories from unix machine to linux machine. what is the exact command? thanks... (2 Replies)
Discussion started by: legato
2 Replies

10. UNIX for Dummies Questions & Answers

How do I change ownership of a directory and all of it's files.

How do I change ownership of a directory and all of it's files without changing permissions? (1 Reply)
Discussion started by: mborin
1 Replies
Login or Register to Ask a Question