LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   su - password not accepted; root console login fine (https://www.linuxquestions.org/questions/linux-security-4/su-password-not-accepted%3B-root-console-login-fine-602295/)

mrclisdue 11-25-2007 03:19 PM

su - password not accepted; root console login fine
 
Slackware 12.0

Just a recent occurrence.

I can login as root, no problem.

However, I can't su - without the password being rejected.

I can sudo -s to root.

I'm stumped.

win32sux 11-25-2007 03:36 PM

When did it start happening? Are you using PAM? If so, what does your /etc/pam.d/su file look like? Also, you are positive that you actually do have a root password set, right? You can check your /etc/shadow file for that. Remember that the password you enter when you sudo is your non-root user's password - not root's. I know these are basic things you likely already checked - I'm just making sure.

mrclisdue 11-25-2007 03:53 PM

It started happening today.

I'm not using PAM - the machine I'm running slack on is *well-protected*, and is just for screwing around with.

I moved everything from /bin to another partition, then realized it was a combination of pointless and not-well-thought-out, so I moved everything back. I'm guessing this marked the beginning of my issues.

A root password exists - it's in /etc/shadow, as well as the fact that I need the pw to login to a console. It seems that the only time I can't go to root is with an su.

cheers,

win32sux 11-25-2007 04:13 PM

Check the permissions on your su binary. Is it SUID root?

Also, what is the exact error message you get when your password gets rejected?

mrclisdue 11-25-2007 04:37 PM

Quote:

Originally Posted by win32sux (Post 2970432)
Check the permissions on your su binary. Is it SUID root?

No! But I certainly didn't chmod -s the file.

So I set it, and it now works.

btw, the error message in the terminal was "Sorry".

As for /var/log/secure: Authentication failed for root

I'm somewhat curious as to what went wrong.

Thanks for your prompt help, you've saved me much time searching for answers.

cheers,

win32sux 11-25-2007 05:24 PM

I'm glad that was it cuz I was running out of ideas. :)

You should check any other binaries that need SUID to make sure they didn't lose it also.

Here's the ones on my box (stock Ubuntu) in case it helps:
Code:

win32sux@candystore:~$ sudo find / -user root -perm -4000
/bin/su
/bin/ping
/bin/check-foreground-console
/bin/mount
/bin/ping6
/bin/umount
/bin/fusermount
/lib/dhcp3-client/call-dhclient-script
/usr/bin/X
/usr/bin/mtr
/usr/bin/chfn
/usr/bin/chsh
/usr/bin/sudo
/usr/bin/lppasswd
/usr/bin/fping
/usr/bin/traceroute6.iputils
/usr/bin/arping
/usr/bin/fping6
/usr/bin/newgrp
/usr/bin/passwd
/usr/bin/gpasswd
/usr/bin/sudoedit
/usr/lib/eject/dmcrypt-get-device
/usr/lib/openssh/ssh-keysign
/usr/lib/pt_chown
/usr/sbin/pppd
/usr/sbin/exim4

What filesystem did the partition you moved /bin to have?

My guess is the filesystem didn't honor SUID or something like that - not sure.


All times are GMT -5. The time now is 01:37 AM.