The UNIX and Linux Forums  

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
command to copy files with original ownership need_help UNIX for Advanced & Expert Users 3 02-08-2008 04:46 PM
100% ownership to files Terrible UNIX for Dummies Questions & Answers 3 12-05-2006 10:40 AM
files ownership/permission problem jop Linux 1 03-30-2006 12:31 PM
Files in work directory reverting to root ownership canman UNIX for Dummies Questions & Answers 1 06-16-2005 08:24 AM
How do I change ownership of a directory and all of it's files. mborin UNIX for Dummies Questions & Answers 1 02-25-2001 03:24 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-30-2003
Registered User
 

Join Date: Dec 2003
Posts: 2
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
Forum Sponsor
  #2  
Old 12-30-2003
Moderator
 

Join Date: Dec 2003
Location: /dev/fl
Posts: 1,061
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
Registered User
 

Join Date: Dec 2003
Posts: 2
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
Kelam_Magnus's Avatar
Registered User
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
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.
__________________
My brain is your brain
  #5  
Old 12-31-2003
kduffin's Avatar
UN1X
 

Join Date: Nov 2003
Location: Virginia
Posts: 441
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
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:58 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0