SUDO not working for rehash command.



  • 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.



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

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



  • @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.



  • 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".



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



  • 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).



  • @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?



  • There is no need to rehash when using bash.



  • @cmb:

    There is no need to rehash when using bash.

    I was supposing it.
    Thanks you.


Log in to reply