Announcement

Collapse
No announcement yet.

How do I delete a locked file I created in sudoers.d?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] How do I delete a locked file I created in sudoers.d?

    Title says it all, how do I rm a locked file in sudoers.d?
    If you think Education is expensive, try ignorance.

    The difference between genius and stupidity is genius has limits.

    #2
    Be careful
    Navigate to the file location in Dolphin
    Right click space and from the menu select > open terminal here
    Type: su
    hit enter
    Now enter your password

    Code:
    rm <filename>
    kubuntu 20.10

    Comment


      #3
      Just lurking around, but for a single command, wouldn't it be better to just use sudo rm filename ??
      Is it a good idea to delete sudoers.d??
      Last edited by kyonides; Jan 24, 2020, 02:07 PM. Reason: Illogical procedure
      Multibooting: Kubuntu Noble 24.04
      Before: Jammy 22.04, Focal 20.04, Precise 12.04 Xenial 16.04 and Bionic 18.04
      Win XP, 7 & 10 sadly
      Using Linux since June, 2008

      Comment


        #4
        NO!!!!

        First, sudoers.d is a directory. Second, DON'T. Period.
        Windows no longer obstructs my view.
        Using Kubuntu Linux since March 23, 2007.
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          Code:
          claydoh@claydoh-Elite-8300:~/Downloads$ sudo cat /etc/sudoers.d/README  
          [sudo] password for claydoh: 
          #
          # As of Debian version 1.7.2p1-1, the default /etc/sudoers file created on
          # installation of the package now includes the directive:
          # 
          #       #includedir /etc/sudoers.d
          # 
          # This will cause sudo to read and parse any files in the /etc/sudoers.d 
          # directory that do not end in '~' or contain a '.' character.
          # 
          # Note that there must be at least one file in the sudoers.d directory (this
          # one will do), and all files in this directory should be mode 0440.
          # 
          # Note also, that because sudoers contents can vary widely, no attempt is 
          # made to add this directive to existing sudoers files on upgrade.  Feel free
          # to add the above directive to the end of your /etc/sudoers file to enable 
          # this functionality for existing installations if you wish!
          #
          # [B]Finally, please note that using the visudo command is the recommended way[/B]
          #[B] to update sudoers content, since it protects against many failure modes.[/B]
          # [B]See the man page for visudo for more information.[/B]
          #
          So, use visudo to undo the changes made, as opposed to random file deletions,
          I will assume that visudo was used to make the changes to begin with?

          Comment


            #6
            Originally posted by Snowhog View Post
            NO!!!!

            First, sudoers.d is a directory. Second, DON'T. Period.
            I want to remove a file I created IN the sudoers.d directory, not the directory itself.
            If you think Education is expensive, try ignorance.

            The difference between genius and stupidity is genius has limits.

            Comment


              #7
              Originally posted by SpecialEd View Post
              I want to remove a file I created IN the sudoers.d directory, not the directory itself.
              My reply was to kyonides post, not yours.
              Windows no longer obstructs my view.
              Using Kubuntu Linux since March 23, 2007.
              "It is a capital mistake to theorize before one has data." - Sherlock Holmes

              Comment


                #8
                I was trying to replicate a hack I copied from oshunluver about a year back or so, on my previous laptop, to enable updates and upgrades without having to enter a password. (it also involved creating an alias). Anyway, I created a file in sudoers.d that is corrupt and now when I try to do updates and upgrades I get error messages regarding that file.
                Attached Files
                If you think Education is expensive, try ignorance.

                The difference between genius and stupidity is genius has limits.

                Comment


                  #9
                  Originally posted by Snowhog View Post
                  My reply was to kyonides post, not yours.
                  Gotcha.
                  If you think Education is expensive, try ignorance.

                  The difference between genius and stupidity is genius has limits.

                  Comment


                    #10
                    Nevermind, it may not have been the most elegant solution but I ended up booting into a live disk and deleting the file from there. All back to normal. Thanks.

                    P.S. Claydo, thanks for the info, I'm still trying to wrap my head around the man pages for visudo and also accessing root.
                    If you think Education is expensive, try ignorance.

                    The difference between genius and stupidity is genius has limits.

                    Comment

                    Working...
                    X