ownership of files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers ownership of files
# 1  
Old 12-30-2003
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 have to go under username and change all the ownership back to root and then manually change the ones i want under username? How would I do that?

Thank you
scott
# 2  
Old 12-30-2003
Sorry to have to tell you this but there is no easy way
of backing out this sort of change.
# 3  
Old 12-30-2003
Can you explain to me why i can't even su to my user name from root? Or if i wanted to change ownership to root how would i do that?

thanks
# 4  
Old 12-31-2003
It would help to know what directory you were in at the time you entered that command...

As you have found out using any recursive function is very dangerous especially with the * option. They can be a deadly combination.

Lucky for you, changing ownership is not as deadly as changing all the exe permissions to 444. which can be deadly.



Basically, You need to check the ownership in /sbin, /usr/bin and /usr/sbin. And maybe /etc as well. This will get you back on your feet. I would hope You have a backup of some kind if you need it to restore from.


On my box /usr files are all owned by root:sys
Under /usr/sbin most all of them are owned by bin:bin
Under /usr/bin most all are owned by bin:bin


The su command is under /usr/bin/su.
# 5  
Old 12-31-2003
su generally will have the setuid bit set. Thus:

-r-sr-xr-x 1 root sys 17568 Nov 5 2001 /usr/bin/su

# chown root:sys /usr/bin/su
# chmod 4755 /usr/bin/su

Cheers,

Keith
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to check files ownership

Hi All, I wanted to check the files ownership and permission based on the path given it as arguments thru script. I was able to get the required command using ls but i would like this command to put in a script and check the file ownership against the what it needs to be and report back if... (12 Replies)
Discussion started by: Optimus81
12 Replies

2. UNIX for Advanced & Expert Users

SuSE-11 Ownership of files having root got changed

Hi Experts, I have create a new user with uid and gid as 0 in SuSE-11 Server. After that all the files having root owner ship are showing as new user name as owner. If I login as root, and type 'id' command, it also shows the new user. Sample output from my server. host:~ # id uid=0(test)... (4 Replies)
Discussion started by: vipinable
4 Replies

3. 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

4. UNIX for Dummies Questions & Answers

Getting rid of files with no ownership

I am in the process of learning how to do system administration (just on my own Linux machine) and have been working with the find command. One of the things I tried was find / -nouser -o -nogroup I redirected the output of my find query into a text file, and when I did a wc -l on it, it... (1 Reply)
Discussion started by: kermit
1 Replies

5. UNIX for Dummies Questions & Answers

copy all files and folders and cjange or remove ownership

So tried: cp -r -p test1/ user@machine:///srv/www/vhosts/domain.co.uk/httpdocs/backup/ but this didn't work either :( Anyone able to help with this? Many thanks Mr M (3 Replies)
Discussion started by: misterm
3 Replies

6. UNIX for Advanced & Expert Users

command to copy files with original ownership

Hi, I need a command that to copy files from others and to keep files' ownership. Example: I copy file.txt from users "abc" to my local, and file.txt is own by user "abc" in local. Thanks in advance! (3 Replies)
Discussion started by: need_help
3 Replies

7. UNIX for Dummies Questions & Answers

100% ownership to files

ok. this is a bit complicated. i have a manager here who wants me to give another user access to all the files he owns. he wants this other user to have the same rights has he does. the problem has been that whenever the manager creates a new file the permissions on the files created... (3 Replies)
Discussion started by: Terrible
3 Replies

8. Linux

files ownership/permission problem

all the files and directories in my system are owned by root only.i try to(from root loggin) change the permission on the file but not permitted.can any one help to fix my problem .also while installing any software always error occur like no makefile available (1 Reply)
Discussion started by: jop
1 Replies

9. UNIX for Dummies Questions & Answers

Files in work directory reverting to root ownership

Hi, I have a problem with a Unix server we do not adminster but have an application running on. The problem is that overnight, files in the /user4/work directory revert to root ownership. This causes problems as we cannot process the files. 1) What would be causing files to revert to root... (1 Reply)
Discussion started by: canman
1 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