LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Can't su to root, after issuing chmod -s /bin/su (https://www.linuxquestions.org/questions/linux-security-4/cant-su-to-root-after-issuing-chmod-s-bin-su-866935/)

trancephorm 03-07-2011 06:18 AM

Can't su to root, after issuing chmod -s /bin/su
 
When I try to issue "su -", I get "su: Authentication failure", and I'm 100% sure password I enter is ok.

I think it started to happen after I issued
chmod +s /usr/bin/screen
chmod 755 /usr/bin/screen
which I believe is unrelated to this problem, and,
chmod -s /bin/su (-s by mistake)
chmod 755 /bin/su
which most probably made the whole mess...

this is not the part of the problem I believe but here's some background why I did that... when trying to make possible for screen sessions to be started automatically on boot under non-root account, I entered something like "su - username -c "/usr/bin/screen -dmS screenname ./executable-file"" in bootmisc.sh, but I was getting "must run suid root for multiuser support", so I tried to fix it, and now I can't login to root account no way :(

Is there any way to heal the situation?

druuna 03-07-2011 07:14 AM

Hi,

It looks like the permissions on /bin/su are not correct, which you did yourself with the chmod 755 /bin/su statement.

Restore the original permissions (as root):
Code:

chmod 4755 /bin/su
An ls -l on that file should now show:

-rwsr-xr-x 1 root root 34024 Feb 11 21:54 /bin/su

instead of

-rwxr-xr-x 1 root root 32024 Feb 11 21:54 /bin/su

Hope this helps.

trancephorm 03-07-2011 07:24 AM

Thanks, I guess I must do it from some live bootable CD? My current user is not privileged enough for chmod 4777 /bin/su ..

druuna 03-07-2011 07:42 AM

Hi,

Using a live cd should work.

trancephorm 03-08-2011 02:23 AM

Thanks for feedback, it's solved now...

Reuti 03-08-2011 04:27 AM

How do you login? You could have used "CTRL-ALT-F1" to get a text screen and login there as root when you have a GUI with automatic login to your user account by default. Back with "ALT-F7".


All times are GMT -5. The time now is 11:13 AM.