Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Operatin not permitted - SSH as root, trying to delete files

    General pfSense Questions
    3
    5
    1647
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      altiris last edited by

      I sshed into my pfsense box a root and untarred a pfsense backup that was in the root directory to see if it was just an .xml or the whole thing. Turned out it was the whole thing and now my root directory is filled with what would be found on /

      I tried deleting some files but I am getting

      rm: boot/loader.rc: Operation not permitted
      rm: boot/: Directory not empty
      rm: lib/libthr.so.3: Operation not permitted
      rm: lib/libcrypt.so.5: Operation not permitted
      rm: lib/libc.so.7: Operation not permitted
      rm: lib: Directory not empty
      rm: libexec/ld-elf.so.1: Operation not permitted
      rm: libexec/: Directory not empty
      rm: sbin/init: Operation not permitted
      rm: sbin/: Directory not empty
      rm: usr/lib/librt.so.1: Operation not permitted
      rm: usr/lib: Directory not empty
      rm: usr/bin/crontab: Operation not permitted
      rm: usr/bin/su: Operation not permitted
      rm: usr/bin/opiepasswd: Operation not permitted
      rm: usr/bin/passwd: Operation not permitted
      rm: usr/bin/opieinfo: Operation not permitted
      rm: usr/bin/chsh: Operation not permitted
      rm: usr/bin/chfn: Operation not permitted
      rm: usr/bin/chpass: Operation not permitted
      rm: usr/bin: Directory not empty
      rm: usr/: Directory not empty
      
      

      Why is this? I am root user am I not? I even tried doing su - but that still did not work.

      1 Reply Last reply Reply Quote 0
      • Derelict
        Derelict LAYER 8 Netgate last edited by

        I would reinstall and restore your config.xml

        1 Reply Last reply Reply Quote 0
        • A
          altiris last edited by

          @Derelict:

          I would reinstall and restore your config.xml

          I am sorry I am not trying to be rude but I do not think you read my post correctly? I extracted that .tgz file in the /root directory, not / so all of my files in / should be fine…?

          1 Reply Last reply Reply Quote 0
          • C
            cmb last edited by

            That would be the safest thing to do at this point, but yeah given it's limited to /root/ it's not strictly necessary. You probably need to set noschg before deleting.

            cd /root/ && chflags -R noschg *
            

            Then the rm -rf you were trying. Make sure you only do that when you're in /root/ otherwise you'll be doing the reinstall and restore. Make sure to backup your config before doing that just in case.

            1 Reply Last reply Reply Quote 0
            • A
              altiris last edited by

              @cmb:

              That would be the safest thing to do at this point, but yeah given it's limited to /root/ it's not strictly necessary. You probably need to set noschg before deleting.

              cd /root/ && chflags -R noschg *
              

              Then the rm -rf you were trying. Make sure you only do that when you're in /root/ otherwise you'll be doing the reinstall and restore. Make sure to backup your config before doing that just in case.

              Haa haa you are great! Instead of * I just specified the few files/folders that I needed to delete and the rm -Rf command worked like a charm!

              Thanks!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              Products

              • Platform Overview
              • TNSR
              • pfSense
              • Appliances

              Services

              • Training
              • Professional Services

              Support

              • Subscription Plans
              • Contact Support
              • Product Lifecycle
              • Documentation

              News

              • Media Coverage
              • Press
              • Events

              Resources

              • Blog
              • FAQ
              • Find a Partner
              • Resource Library
              • Security Information

              Company

              • About Us
              • Careers
              • Partners
              • Contact Us
              • Legal
              Our Mission

              We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

              Subscribe to our Newsletter

              Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

              © 2021 Rubicon Communications, LLC | Privacy Policy