I have a problem that I've been trying to fix for the last few days. Each time I resolve an issue, a new one pops up.
Let me outline what has happened.
- I foolishly deleted all sub dirs in the /usr folder.
- I booted from the LiveCD with the same version (14.04.5 LTS Server) and chrooted the /usr/bin and copied the directories back using this guide deleted all the files in usr/bin typing in rm -rf *
- I tried running sudo to restart a service and was presented with the "sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set"
From that same guide above, I executed the following commands after entering recovery mode
mount -o remount,rw / chown -R root:root /usr/bin chmod a=rx,u+ws /usr/bin/sudo chmod a=rx,u+ws /usr/bin/pkexec
on reboot SUDO now throws the following error "Segmentation fault (core dumped)"
I've been looking around and I can find several solutions that are similar to my issue, but nothing actually covering this particular circumstance.
I'm not sure what information you need but here is what I have.
ls -l /sur/bin/sudo outputs
-rwsr-xr-x 1 root root 155008 Sep 23 16:50 /usr/bin/sudo
strace sudo is quite long so i have posted it here https://paste.ubuntu.com/23230057/
I've looked up the ""sudo: effective uid is not 0, is"...," but again, although the symptoms are similar, the solutions seem to be unrelated and don't work.
Another thing that has started to happen since the Segmentation fault has started to occur is only being able to log into the system via SSH, from the console at the system itself, anything typed in at the login prompt is ignored.
My shared drives are no longer accessible from other pc's but are still mounted locally and accessbile (in /media/)
Thank you for your time.