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

    SUDO not working for rehash command.

    Scheduled Pinned Locked Moved General pfSense Questions
    9 Posts 4 Posters 4.1k 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.
    • S
      Sopalajo de Arrierez
      last edited by

      If I SSH log with my unprivileged user:

      [luis@pfSense-ThreepWood ~]$ sudo rehash
      sudo: rehash: command not found
      [luis@pfSense-ThreepWood ~]$ sudo -s
      [root@pfSense-ThreepWood /home/luis]# rehash
      bash: rehash: command not found
      

      But if I SSH log as "admin":

      [2.3-BETA][admin@pfSense-ThreepWood.localdomain]/root: rehash
      [2.3-BETA][admin@pfSense-ThreepWood.localdomain]/root:
      

      No problem at all.

      Why is this happening?
      Is there any limitation with the sudo command on pfSense?

      Note that I am using pfSense 2.3Beta. I don't know if this could cause the problem.

      1 Reply Last reply Reply Quote 0
      • H
        heper
        last edited by

        sudo does not exist … it isn't included in pfsense
        neither is bash

        its you own choice ofcourse to mess with adding additional packages ...

        1 Reply Last reply Reply Quote 0
        • S
          Sopalajo de Arrierez
          last edited by

          @heper:

          sudo does not exist … it isn't included in pfsense

          But this is what I get when searching into the package installer:

          [2.3-BETA][admin@pfSense-ThreepWood.localdomain]/root: pkg search sudo
          pfSense-pkg-sudo-0.2.9         pfSense package sudo
          sudo-1.8.15                    Allow others to run commands as root
          

          @heper:

          neither is bash

          Same case:

          [2.3-BETA][admin@pfSense-ThreepWood.localdomain]/root: pkg search bash
          bash-4.3.42_1                  The GNU Project's Bourne Again SHell
          

          Maybe I have messed something on the repos file? I don't even remember where it is, due to I am new to pfSense and FreeBSD.

          1 Reply Last reply Reply Quote 0
          • S
            Sopalajo de Arrierez
            last edited by

            How can I tell my installed Bash and SUDO packages are or not pfSense official ones?
            I think I installed them via "pkg install". I am nearly sure the only package from official FreeBSD repos installed until now is "Nano Editor".

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

              You changed your shell to bash. rehash doesn't exist in bash.

              1 Reply Last reply Reply Quote 0
              • P
                phil.davis
                last edited by

                For the benefit of future readers, there is a sudo package in the pfSense packages list - you install that from the webGUI and then you get the sudo binaries and a webGUI interface to configure sudo settings (which I find are fine in their default state as they come with the pfSense package).

                As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

                1 Reply Last reply Reply Quote 0
                • S
                  Sopalajo de Arrierez
                  last edited by

                  @cmb:

                  You changed your shell to bash. rehash doesn't exist in bash.

                  So that means there is no need to rehash when my shell is Bash? Or maybe should I use another method, like rebooting?

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

                    There is no need to rehash when using bash.

                    1 Reply Last reply Reply Quote 0
                    • S
                      Sopalajo de Arrierez
                      last edited by

                      @cmb:

                      There is no need to rehash when using bash.

                      I was supposing it.
                      Thanks you.

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