LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to i change file owner back to root ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-i-change-file-owner-back-to-root-194666/)

glacier1985 06-17-2004 02:08 PM

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

darthtux 06-17-2004 02:11 PM

chown -R root directory_name

If you changed the group ownership also make that
chown -R root:root directory_name

glacier1985 06-17-2004 04:11 PM

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 ?

darthtux 06-17-2004 04:30 PM

1) Just to make sure, you are root when doing this?

2) What is the output of
ls -l /bin/su

glacier1985 06-17-2004 07:00 PM

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

darthtux 06-17-2004 07:17 PM

Hit
ctr+alt+f2
and login as root

glacier1985 06-17-2004 07:41 PM

hmm... no luck, gives the same error message.

glacier1985 06-17-2004 07:51 PM

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]$

d00msweek 06-17-2004 08:24 PM

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

darthtux 06-17-2004 08:28 PM

On my su it has the suid bit set. Try
chmod u+s /bin/su

glacier1985 06-17-2004 09:20 PM

good, it's working now thank you so much


All times are GMT -5. The time now is 12:28 AM.