On an AWS EC2 instance, I was upgrading imagemagick. Current installation was
6.8.x which is vulnerable, and I was moving it to
6.9.10-12 which if I read properly, I think it's patched.
Somewhere during the process, I stumbled upon the following error when executing a sudo command:
-bash sudo: Too many levels of symbolic links [paraphrased]
This was when trying to add a new link onto
So I had a look inside to see if there was something funky in there... and I found a
bin folder inside
/usr/bin/ that was linked to
During that time, I temporarily lost internet access, which was regained rather quickly, so I re-start my ssh connection to the ec2 instance and lo and behold....
$ sudo The program 'sudo' can be found in the following packages: * sudo * sudo-ldap Try: sudo apt install <selected package>
So... now my user lost access to sudo as well... any sort of command to fix any links inside
/usr/bin will need sudo access... installing sudo needs sudo access... going
su - to switch to root, seems to also need sudo access because it otherwise asks me for password for root, and aws does not give you that when launching an instance...
Would the steps detailed on this answer be my only way to fix this now? (If this can be fixed at all!?)