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

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

    Scheduled Pinned Locked Moved General pfSense Questions
    5 Posts 3 Posters 2.5k Views
    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
      • DerelictD
        Derelict LAYER 8 Netgate
        last edited by

        I would reinstall and restore your config.xml

        Chattanooga, Tennessee, USA
        A comprehensive network diagram is worth 10,000 words and 15 conference calls.
        DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
        Do Not Chat For Help! NO_WAN_EGRESS(TM)

        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
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.