Host of issues stemming from too many symlink levels errors

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Ok. I understand the title can be misleading or confusing... so plz bear with me.



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 /usr/bin/.



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 /usr/bin//



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!?)









share







New contributor




EffectiX is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    0
    down vote

    favorite












    Ok. I understand the title can be misleading or confusing... so plz bear with me.



    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 /usr/bin/.



    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 /usr/bin//



    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!?)









    share







    New contributor




    EffectiX is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Ok. I understand the title can be misleading or confusing... so plz bear with me.



      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 /usr/bin/.



      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 /usr/bin//



      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!?)









      share







      New contributor




      EffectiX is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      Ok. I understand the title can be misleading or confusing... so plz bear with me.



      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 /usr/bin/.



      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 /usr/bin//



      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!?)







      ubuntu symlink amazon-ec2 aws





      share







      New contributor




      EffectiX is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      EffectiX is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      EffectiX is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 9 mins ago









      EffectiX

      101




      101




      New contributor




      EffectiX is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      EffectiX is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      EffectiX is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          EffectiX is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475648%2fhost-of-issues-stemming-from-too-many-symlink-levels-errors%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          EffectiX is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          EffectiX is a new contributor. Be nice, and check out our Code of Conduct.












          EffectiX is a new contributor. Be nice, and check out our Code of Conduct.











          EffectiX is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475648%2fhost-of-issues-stemming-from-too-many-symlink-levels-errors%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?