LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-17-2004, 02:08 PM   #1
glacier1985
Member
 
Registered: Jul 2003
Posts: 40

Rep: Reputation: 15
how to i change file owner back to root ?


couple days ago, i have accentally changed /etc, /bin folders -R to user glacier1985
now i find out htat i can not use su command any more it gives su: cannot set groups: Operation not permitted

so i just wanna know how do i change everything back to file owner root again thank you all in advance
 
Old 06-17-2004, 02:11 PM   #2
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
chown -R root directory_name

If you changed the group ownership also make that
chown -R root:root directory_name
 
Old 06-17-2004, 04:11 PM   #3
glacier1985
Member
 
Registered: Jul 2003
Posts: 40

Original Poster
Rep: Reputation: 15
hmm... i tried it and it gives me this error message:
chown: changing ownership of `/bin/su': Operation not permitted

but when do su it gives su: cannot set groups: Operation not permitted
so i am kinda stuck.
any ideas ?
 
Old 06-17-2004, 04:30 PM   #4
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
1) Just to make sure, you are root when doing this?

2) What is the output of
ls -l /bin/su
 
Old 06-17-2004, 07:00 PM   #5
glacier1985
Member
 
Registered: Jul 2003
Posts: 40

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by darthtux
1) Just to make sure, you are root when doing this?

2) What is the output of
ls -l /bin/su
1). how can i be root without doing su ?, i can only enter the root password when xwindow prompts
2) the output of ls -l /bin/su is

-rwxrwxrwx 1 glacier1985 root 104622 May 4 12:25 /bin/su
 
Old 06-17-2004, 07:17 PM   #6
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
Hit
ctr+alt+f2
and login as root
 
Old 06-17-2004, 07:41 PM   #7
glacier1985
Member
 
Registered: Jul 2003
Posts: 40

Original Poster
Rep: Reputation: 15
hmm... no luck, gives the same error message.
 
Old 06-17-2004, 07:51 PM   #8
glacier1985
Member
 
Registered: Jul 2003
Posts: 40

Original Poster
Rep: Reputation: 15
holy sh*t after i did chown -R root /bin /etc i got these errors and i am sure that the password i enter is correct


[glacier1985@localhost glacier1985]$ su
Password:
su: incorrect password
[glacier1985@localhost glacier1985]$
 
Old 06-17-2004, 08:24 PM   #9
d00msweek
Member
 
Registered: Jan 2004
Location: Cebu City, Philippines
Distribution: Slackware 10,Gentoo 2005.1,LFS
Posts: 92

Rep: Reputation: 15
maybe you forgot your password ?
just log in as root and chown -R root /bin && chown -R root /etc

if you really forgot your root password ( i dont know why someone would forgot their password )
this might help : http://www.desktop-linux.net/root-password.htmRoot Password Recovery Guide

Last edited by d00msweek; 06-17-2004 at 08:31 PM.
 
Old 06-17-2004, 08:28 PM   #10
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
On my su it has the suid bit set. Try
chmod u+s /bin/su
 
Old 06-17-2004, 09:20 PM   #11
glacier1985
Member
 
Registered: Jul 2003
Posts: 40

Original Poster
Rep: Reputation: 15
good, it's working now thank you so much
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
File owner and File group locked - root deiphage Linux - Hardware 5 02-05-2005 01:30 PM
Change Login Default Back to Root? jbrush Mandriva 2 12-01-2004 01:59 PM
file permissions and file owner won't change Nadim Slackware 5 11-29-2003 06:03 PM
Change file owner in W2K on a RH8 server RobLea Linux - Networking 1 10-09-2003 05:23 PM
Change owner juno Linux - General 3 01-08-2003 07:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration