I'm running CentOS7 on an old dell box that I repurposed as a home server. I also ssh into it from a remote location to make sure everything is running smoothly, and to do things like rsync my laptop. In other terms, nobody is usually at home to reset the machine if anything goes wrong.
Sometime last week, I must have broken something that allows commands like sudo, su, and pkexec to work.
Su won’t accept my root password, sudo gives the error:
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
I tried running something like pkexec /bin/bash, but I got the error:
pkexec must be setuid root
seeing that, I then did:
[crlsmdrn@server ~]$ ls -l /usr/bin/sudo
---x--x--x. 1 root root 143248 Jun 27 13:03 /usr/bin/sudo
So, is there any way to set permissions back to 4755 on sudo so I can get a root shell back remotely without having to reboot the machine?