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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-30-2003
szhu szhu is offline
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
  #2 (permalink)  
Old 12-30-2003
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,937
Sorry to have to tell you this but there is no easy way
of backing out this sort of change.
  #3 (permalink)  
Old 12-30-2003
szhu szhu is offline
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 (permalink)  
Old 12-31-2003
Kelam_Magnus's Avatar
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
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.
  #5 (permalink)  
Old 12-31-2003
kduffin's Avatar
kduffin kduffin is offline Forum Advisor  
UN1X
  
 

Join Date: Nov 2003
Location: Maryland
Posts: 449
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:34 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0