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

chown use

General pfSense Questions
2
13
385
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.
  • J
    JonathanLee
    last edited by JonathanLee Jan 4, 2025, 7:21 PM Jan 4, 2025, 7:20 PM

    does anyone know the correct command for this

    Shell Output - chown -R -v proxy:proxy /root/LOGS_Optane/squid_logs
    chown: /root/LOGS_Optane/squid_logs/access.log: Invalid argument
    chown: /root/LOGS_Optane/squid_logs: Invalid argument
    

    I am trying to change ownership so that Squid can write logs to an external drive this is my mount point

    Squid uses squid proxy

    Shell Output - ls -l /var/squid/logs
    total 39073
    -rw-r-----  1 squid  proxy   1838262 Jan  4 11:20 access.log
    -rw-r-----  1 squid  proxy  14393381 Jan  4 00:00 access.log.0
    -rw-r-----  1 squid  proxy  11785544 Jan  3 00:00 access.log.1
    -rw-r-----  1 squid  proxy   3985255 Jan  1 23:57 access.log.2
    -rw-r-----  1 squid  proxy   4329773 Dec 31 23:56 access.log.3
    -rw-r-----  1 squid  proxy  12311881 Dec 30 23:59 access.log.4
    -rw-r-----  1 squid  proxy   2071481 Dec 29 23:59 access.log.5
    -rw-r-----  1 squid  proxy   3093808 Dec 29 12:19 access.log.6
    -rw-r-----  1 squid  proxy   1242651 Jan  4 11:05 cache.log
    -rw-r-----  1 squid  proxy  14890329 Jan  3 21:02 cache.log.0
    -rw-r-----  1 squid  proxy   7508274 Jan  2 23:59 cache.log.1
    -rw-r-----  1 squid  proxy   1554815 Jan  1 20:58 cache.log.2
    -rw-r-----  1 squid  proxy   2692128 Dec 31 23:48 cache.log.3
    -rw-r-----  1 squid  proxy   9846991 Dec 30 22:13 cache.log.4
    -rw-r-----  1 squid  proxy   1347548 Dec 29 23:59 cache.log.5
    -rw-r-----  1 squid  proxy   2074820 Dec 29 12:18 cache.log.6
    -rw-r-----  1 squid  proxy    126899 Jan  4 10:30 netdb.state
    

    however they are stuck in wheel and it cant write to it

    Shell Output - ls -l /root/LOGS_Optane
    total 192
    -rwxr-xr-x  1 root  wheel     14 Jan  4 10:26 logtest.txt
    drwxr-xr-x  1 root  wheel  32768 Jan  4 10:47 squid_core_dump
    drwxr-xr-x  1 root  wheel  32768 Jan  4 10:49 squid_logs
    

    Make sure to upvote

    P 1 Reply Last reply Jan 4, 2025, 7:39 PM Reply Quote 0
    • P
      patient0 @JonathanLee
      last edited by patient0 Jan 4, 2025, 7:43 PM Jan 4, 2025, 7:39 PM

      @JonathanLee the command looks fine, as long the files are a filesystem that handles ownership.

      The fat* filesystems for example does not know of ownership.

      Add: and you have to run it as user root

      J 1 Reply Last reply Jan 4, 2025, 7:46 PM Reply Quote 0
      • J
        JonathanLee @patient0
        last edited by JonathanLee Jan 4, 2025, 7:49 PM Jan 4, 2025, 7:46 PM

        @patient0 Thanks so I have this under a fat32 file system because I could not mount the freebsd zfs filesystem it said integerity issues when I would try to mount it

         Shell Output - gpart show nda0
        =>       40  500118112  nda0  GPT  (238G)
                 40       2008        - free -  (1.0M)
               2048   16777216     1  freebsd-swap  (8.0G)
           16779264  482344960     2  efi  (230G)
          499124224     993928        - free -  (485M)
        

        I am using 2 efi

        Make sure to upvote

        P 1 Reply Last reply Jan 4, 2025, 7:57 PM Reply Quote 0
        • P
          patient0 @JonathanLee
          last edited by Jan 4, 2025, 7:57 PM

          @JonathanLee you can try (or search for similar topic)

          https://forums.freebsd.org/threads/mount-usb-stick-with-fat32-file-system.56675/

          "By default, only root is allowed to mount devices. You need to make a few changes to allow users to mount things.
          

          I'm out of my depth on FreeBSD here and have not tried the above mentioned! If you can specify the exact device and the user you want to use for that partition it may work - if the device number won't change.

          J 1 Reply Last reply Jan 4, 2025, 8:06 PM Reply Quote 0
          • J
            JonathanLee @patient0
            last edited by Jan 4, 2025, 8:06 PM

            @patient0 I figured it out after you create the mount folder you have to change the permissions before you mount it if you do it after it is locked it and can't be changed. Again, that still gives me errors for Squid accessing it and utilizing it for logs. But it works for chown

            Make sure to upvote

            P 1 Reply Last reply Jan 4, 2025, 8:32 PM Reply Quote 0
            • P
              patient0 @JonathanLee
              last edited by patient0 Jan 4, 2025, 8:44 PM Jan 4, 2025, 8:32 PM

              @JonathanLee that user and group are correct now as squid:proxy?

              In general the squid:proxy user/group has to be able to get to /root/LOGS_Optane/squid_logs. Meaning /root/LOGS_Optane has to be accessable/traversible for everybody otherwise Squid won't be able to see the squid_logs directory.

              What would the output be of:

              ls -ld /root
              ls -ld /root/LOGS_Optane
              

              If for example it is like below then squid won't be able to reach the squid logs directory because Squid (category 'other' users) doesn't have rights to change into the /root/ directory.

              ls -ld /root/
              drwxr-x---  6 root wheel 512 Jan  4 13:11 /root/
              

              BUT: don't change the permissions for /root! Mount the Optane somewhere "neutral", like /mnt/ or /media

              J 2 Replies Last reply Jan 4, 2025, 9:05 PM Reply Quote 1
              • J
                JonathanLee @patient0
                last edited by JonathanLee Jan 5, 2025, 12:06 AM Jan 4, 2025, 9:05 PM

                @patient0 I got it to be squid proxy the correct way for my folder only not root, again it is a mount point squid still did not like it. I am going to move it to something like mount. I will have to try Monday my family is here and each time it fails the whole proxy crashes with errors saying it can’t write logs. So I got to try when everyone is gone

                Make sure to upvote

                1 Reply Last reply Reply Quote 0
                • J
                  JonathanLee
                  last edited by Jan 5, 2025, 5:26 AM

                  I GOT IT~~~!!! Update coming soon

                  Make sure to upvote

                  1 Reply Last reply Reply Quote 0
                  • J
                    JonathanLee
                    last edited by Jan 5, 2025, 6:13 AM

                    https://forum.netgate.com/topic/195843/unofficial-guide-have-squid-logs-record-to-a-secondary-ssd-drive

                    Make sure to upvote

                    1 Reply Last reply Reply Quote 1
                    • J
                      JonathanLee @patient0
                      last edited by Jan 6, 2025, 5:14 AM

                      @patient0 Quick Question,

                      what is normally in the mnt and media folders on pfsense?

                      Make sure to upvote

                      P 1 Reply Last reply Jan 6, 2025, 5:31 AM Reply Quote 0
                      • P
                        patient0 @JonathanLee
                        last edited by Jan 6, 2025, 5:31 AM

                        @JonathanLee

                        @JonathanLee said in chown use:

                        what is normally in the mnt and media folders on pfsense?

                        Nothing on my pfSense but I'm not sure if any packages mount stuff in there.

                        # ls -l /mnt /media/
                        /media/:
                        total 0
                        
                        /mnt:
                        total 0
                        
                        J 1 Reply Last reply Jan 6, 2025, 5:56 AM Reply Quote 0
                        • J
                          JonathanLee @patient0
                          last edited by Jan 6, 2025, 5:56 AM

                          @patient0 Thanks I started to question if that is a good place to use for the drive I have it dumping logs to it with symbolic links, Squid, Syslog, Snort, I want to cut down on the main ssd use so I have it using this Intel Optane, I started to wonder if mnt is ever used by software locally and if I have something mounted to it can that cause issues.

                          Make sure to upvote

                          P 1 Reply Last reply Jan 6, 2025, 6:06 AM Reply Quote 0
                          • P
                            patient0 @JonathanLee
                            last edited by Jan 6, 2025, 6:06 AM

                            @JonathanLee I'm sure someone with longer and deeper understanding of pfSense will be able to answer that.

                            1 Reply Last reply Reply Quote 0
                            10 out of 13
                            • First post
                              10/13
                              Last post
                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.