LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   problem with owner of files (https://www.linuxquestions.org/questions/linux-general-1/problem-with-owner-of-files-500113/)

bikov_k 11-09-2006 01:15 PM

problem with owner of files
 
Hi guys, you can laugh at me as much as you want because I did something really stupid. :)

I changed the owner and group of some folders and the files inside to root:root. Some of the folders are:

/bin
/usr/bin
/etc
/root
/boot

The result is that I cannot login as root anymore and su doesn't work either.

What should I do? Any ideas?

Thanks,
Kaloyan

Chromezero 11-09-2006 02:29 PM

Changing them to root:root isn't that big of a deal and easily changed. In fact, a lot of those are root:root by default. You say you can't log in as root, is that because you've forgotten the password?

bikov_k 11-09-2006 02:46 PM

Quote:

Originally Posted by Chromezero
Changing them to root:root isn't that big of a deal and easily changed. In fact, a lot of those are root:root by default. You say you can't log in as root, is that because you've forgotten the password?

Yes, most of the files already had root:root owner, and I did not expect to have a problem. Apparently, though, a few critical files might have had some other owner, like system for example. I know the root password and I am typing it correctly but I cannot login directly as root and I cannot use su also. What do you think?

bikov_k 11-09-2006 02:48 PM

For example on another unix system if I list all files in /etc that have some other owner than root I get:

drwxr-xr-x 2 adm adm 512 May 3 2005 acct
drwxrwxr-x 10 lp lp 512 Jul 19 10:18 lp
drwxr-xr-x 2 uucp uucp 512 May 3 2005 uucp
...........................................................

Chromezero 11-09-2006 02:56 PM

Without being able to log in as root, I'm afraid there's not much you can do unless you're backing up the system on a regular basis. Maybe someone else has an idea, but restoring a backup is the only option I can think of. Do you get an error message or anything when you try to "su" or login in as root?

jschiwal 11-09-2006 03:03 PM

These are the permissions of "su" in /bin/ if you have it:
-rwsr-xr-x 1 root root 37440 2006-04-22 23:24 su
Also in bin:
-rwsr-x--- 1 root audio 24384 2006-04-22 21:06 eject
-rwsr-xr-x 1 root root 355645 2006-05-02 01:52 mount
-rwsr-xr-x 1 root root 37656 2006-04-22 20:58 ping
-rwsr-xr-x 1 root root 33912 2006-04-22 20:58 ping6
-rwsr-xr-x 1 root root 37440 2006-04-22 23:24 su
-rwsr-xr-x 1 root root 145299 2006-05-02 01:52 umount

A number of commands in /usr/bin use the sticky bit or have a different group owner:
-rwsr-x--- 1 root trusted 49904 2006-05-02 02:59 at
-rwsr-x--- 1 root trusted 24336 2006-04-22 22:28 bing
-rws--x--x 1 root root 612984 2006-05-02 20:37 cdrdao
-rwsr-xr-x 1 root shadow 83408 2006-05-02 04:02 chage
-rwsr-xr-x 1 root shadow 79584 2006-05-02 04:02 chfn
-rwsr-xr-x 1 root shadow 74904 2006-05-02 04:02 chsh
-rwsr-x--- 1 root trusted 37912 2006-05-29 10:48 crontab
-rwsr-xr-x 1 root shadow 16576 2006-05-02 04:02 expiry
-rwsr-xr-x 1 root shadow 78872 2006-05-02 04:02 gpasswd
-rwsr-xr-x 1 root root 834288 2006-08-06 18:26 gpg
-rws--x--x 1 root root 127442 2006-09-28 16:42 growisofs
-rwsr-xr-x 1 lp sys 12784 2006-04-25 12:14 lppasswd
-rwsr-xr-x 2 root root 7176 2006-04-22 22:36 man
-rwsr-xr-x 2 root root 7176 2006-04-22 22:36 mandb
-rwsr-x--- 1 root trusted 189240 2006-05-01 07:41 ncplogin
-rwsr-x--- 1 root trusted 173976 2006-05-01 07:41 ncpmap
-rwsr-x--- 1 root trusted 180216 2006-05-01 07:41 ncpmount
-rwsr-x--- 1 root trusted 46512 2006-05-01 07:41 ncpumount
-rwsr-xr-x 1 root root 20192 2006-05-02 04:02 newgrp
-rwsr-x--- 1 root trusted 50944 2006-05-01 07:41 nwsfind
-rwsr-xr-x 1 root shadow 78872 2006-05-02 04:02 passwd
-rwsr-xr-x 1 root root 21088 2006-04-22 20:55 rcp
-rwsr-xr-x 1 root root 15808 2006-04-22 20:55 rlogin
-rwsr-xr-x 1 root root 11640 2006-04-22 20:55 rsh
-rwsr-xr-x 1 root root 119480 2006-05-02 02:59 sudo

-rwxr-xr-x 1 root tty 12544 2006-05-02 01:52 wall
-rwxr-xr-x 1 root tty 11408 2006-05-02 01:52 write
-rwxr-x--- 1 root trusted 13336 2006-04-22 22:46 ziptool

Your best bet may be to verify your files using the rpm command, and freshen the packages where you made changes.

Note: I'm not using Fedora Core, so my results may be different. The su and passwd command will need to be changed before you can log in as root or change passwords.


All times are GMT -5. The time now is 03:12 PM.