LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   root password no longer works when loggesd in as user (https://www.linuxquestions.org/questions/slackware-14/root-password-no-longer-works-when-loggesd-in-as-user-466408/)

drkstr 07-21-2006 08:51 PM

root password no longer works when loggesd in as user
 
Well I guess I did something stupid because my root password no longer works when I try to su. I have no idea what is causing this, but I will explain what I did when it started happening.

1. I deleted all the files in /tmp (didn't relaize I needed some of those)
2. When I rebooted and tried to log into my user account (I'm in run level 4) KDE would start to load but then suddenly go back to login prompt
3. I popped over to the console on tty6 to check out the .xseession-errors and it was complaining about some of the /tmp files not being owned by root (the one I deleted not realizing it was important, I think it was .ICE-unix)
4. These files must have been recreated, but were owned by my user, so I did this: 'chown -R root.root /tmp .*' but then quickly aborted realizing that '../' might be included which would not be good.
5. rebooted again. Now I can log in as user, but my root password does not work when I 'su'. My root password will work if I switch to tty6 and log in as root, so I don't think it's a problem with the password files.

Contents of new ~/.xsession-errors for user:
Code:

stderr is not a tty - where are you?
xset:  bad font path element (#68), possible causes are:
    Directory does not exist or has wrong permissions
    Directory missing fonts.dir
    Incorrect font server address or syntax
xset:  bad font path element (#68), possible causes are:
    Directory does not exist or has wrong permissions
    Directory missing fonts.dir
    Incorrect font server address or syntax
startkde: Starting up...
kbuildsycoca running...

Code:

drkstr@dsk:~$ ls -al /tmp
total 36
drwxrwxrwt  8 root  root  4096 2006-07-21 18:32 ./
drwxr-xr-x  18 root  root  4096 2006-07-15 15:51 ../
drwxrwxrwt  2 root  root  4096 2006-07-21 18:32 .ICE-unix/
-r--r--r--  1 root  root    11 2006-07-21 18:32 .X0-lock
drwxrwxrwt  2 root  root  4096 2006-07-21 18:32 .X11-unix/
drwx------  2 root  root  4096 2006-07-21 18:20 kde-drkstr7NUopt/
drwx------  2 drkstr users 4096 2006-07-21 18:32 kde-drkstroWPpXg/
drwx------  2 root  root  4096 2006-07-21 18:20 ksocket-drkstr6Qln2b/
drwx------  2 drkstr users 4096 2006-07-21 18:32 ksocket-drkstrBaUhXe/

Any ideas what I broke, and how to unbroke it?

Also, is there a way to stop KDE (or X11 maybe?) from depending on files in the /tmp directory?

Thanks in advance!
...drkstr

Tinkster 07-22-2006 01:53 AM

I don't know what you broke, but try running
strace -o debug su
and look at the file debug afterwards. Should give you
an indication as to what's going on.


CHeers,
Tink

drkstr 07-22-2006 02:56 AM

<sigh>

This is what I was afraid of. There are a bunch of permission denied errors which means I probably didn't kill me ill-executed chown command in time. I probably changed the group ownership to some necessary files. This is my guess at least, I think I'm still a little to new to Linux to understand debug info compleatly.
Code:

drkstr@dsk:~$ cat debug | grep "Permission denied"
readlink("/proc/self/fd/0", 0x805aa98, 4095) = -1 EACCES (Permission denied)
readlink("/proc/self/fd/0", 0xafcc601c, 511) = -1 EACCES (Permission denied)
open("/var/run/utmp", O_RDWR)          = -1 EACCES (Permission denied)
open("/etc/shadow", O_RDONLY)          = -1 EACCES (Permission denied)
open("/etc/shadow", O_RDONLY)          = -1 EACCES (Permission denied)

I will reinstall the a/ packages and hopefully this will resolve the problem.

Thanks Tink!
...drkstr

drkstr 07-22-2006 03:18 AM

'upgradepkg --reinstall *.tgz' from within the a/ directory did the trick (also remembered to copy my custom kernel back over).

I need to be more careful with .* in the future. Good thing there is a failsafe with 'rm .*' Or I would be in a world of hurt! ;)

Thanks again for the strace command, I need to learn more about this to use it more effectively in the future.

...drkstr

Tinkster 07-22-2006 03:20 AM

You're welcome mate, and glad the fix was easy enough.


Cheers,
Tink


All times are GMT -5. The time now is 06:24 PM.