command not found on centos8 (oracle/rocky linux) #80

Closed
opened 2025-11-20 05:05:57 -05:00 by saavagebueno · 8 comments
Owner

Originally created by @pomazanbohdan on GitHub (Nov 14, 2021).

Originally assigned to: @mlsmaycon on GitHub.

...
Running transaction
  Preparing        :                                                        1/1
  Installing       : wiretrustee-0.2.3-1.x86_64                             1/1
  Running scriptlet: wiretrustee-0.2.3-1.x86_64                             1/1
 Post Install of an clean install
Wiretrustee service has been installed
Wiretrustee service has been started

  Verifying        : wiretrustee-0.2.3-1.x86_64                             1/1

Installed:
  wiretrustee-0.2.3-1.x86_64

Complete!
➜  ~ sudo wiretrustee up --setup-key FB5AD43A-1F8D-4739-BD48-6AF0AE47CBEB
sudo: wiretrustee: command not found

Originally created by @pomazanbohdan on GitHub (Nov 14, 2021). Originally assigned to: @mlsmaycon on GitHub. ``` ... Running transaction Preparing : 1/1 Installing : wiretrustee-0.2.3-1.x86_64 1/1 Running scriptlet: wiretrustee-0.2.3-1.x86_64 1/1 Post Install of an clean install Wiretrustee service has been installed Wiretrustee service has been started Verifying : wiretrustee-0.2.3-1.x86_64 1/1 Installed: wiretrustee-0.2.3-1.x86_64 Complete! ➜ ~ sudo wiretrustee up --setup-key FB5AD43A-1F8D-4739-BD48-6AF0AE47CBEB sudo: wiretrustee: command not found ```
Author
Owner

@pomazanbohdan commented on GitHub (Nov 14, 2021):

if not sudo

~ wiretrustee up --setup-key FB5AD43A-1F8D-4739-BD48-6AF0AE47CBEB
Failed to write to log, error getting log file info: stat /var/log/wiretrustee/client.log: permission denied
Failed to write to log, error getting log file info: stat /var/log/wiretrustee/client.log: permission denied
Error: mkdir /etc/wiretrustee: permission denied
Usage:
  wiretrustee up [flags]

@pomazanbohdan commented on GitHub (Nov 14, 2021): if not sudo ``` ~ wiretrustee up --setup-key FB5AD43A-1F8D-4739-BD48-6AF0AE47CBEB Failed to write to log, error getting log file info: stat /var/log/wiretrustee/client.log: permission denied Failed to write to log, error getting log file info: stat /var/log/wiretrustee/client.log: permission denied Error: mkdir /etc/wiretrustee: permission denied Usage: wiretrustee up [flags] ```
Author
Owner

@mlsmaycon commented on GitHub (Nov 14, 2021):

Hello @pomazanbohdan to help us troubleshoot the issue, could you share the output of the following commands:

get user path

env|grep PATH

get sudo path

sudo env|grep PATH

if the sudo path doesn't have /usr/local/bin in it, could you run the next command?

sudo -E wiretrustee version

This will pass your user's environment variables to the sudo execution.

@mlsmaycon commented on GitHub (Nov 14, 2021): Hello @pomazanbohdan to help us troubleshoot the issue, could you share the output of the following commands: **get user path** ``` env|grep PATH ``` **get sudo path** ``` sudo env|grep PATH ``` if the sudo path doesn't have /usr/local/bin in it, could you run the next command? ``` sudo -E wiretrustee version ``` This will pass your user's environment variables to the sudo execution.
Author
Owner

@pomazanbohdan commented on GitHub (Nov 14, 2021):

Hello @pomazanbohdan to help us troubleshoot the issue, could you share the output of the following commands:

get user path

env|grep PATH

PATH=/home/opc/.local/bin:/home/opc/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin

get sudo path

sudo env|grep PATH

PATH=/sbin:/bin:/usr/sbin:/usr/bin

if the sudo path doesn't have /usr/local/bin in it, could you run the next command?

sudo -E wiretrustee version

This will pass your user's environment variables to the sudo execution.

sudo: wiretrustee: command not found

@pomazanbohdan commented on GitHub (Nov 14, 2021): > Hello @pomazanbohdan to help us troubleshoot the issue, could you share the output of the following commands: > > **get user path** > > ``` > env|grep PATH > ``` PATH=/home/opc/.local/bin:/home/opc/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin > > **get sudo path** > > ``` > sudo env|grep PATH > ``` PATH=/sbin:/bin:/usr/sbin:/usr/bin > > if the sudo path doesn't have /usr/local/bin in it, could you run the next command? > > ``` > sudo -E wiretrustee version > ``` > > This will pass your user's environment variables to the sudo execution. sudo: wiretrustee: command not found
Author
Owner

@pomazanbohdan commented on GitHub (Nov 14, 2021):

rocky linux 8
sudo env|grep PATH
PATH=/sbin:/bin:/usr/sbin:/usr/bin

@pomazanbohdan commented on GitHub (Nov 14, 2021): rocky linux 8 sudo env|grep PATH PATH=/sbin:/bin:/usr/sbin:/usr/bin
Author
Owner

@mlsmaycon commented on GitHub (Nov 14, 2021):

Ok, thanks for running the checks @pomazanbohdan. I will look into a fix for future releases.

Can you confirm if these are default installations of Centos 8 and Rocky Linux 8? Also, are they both Server(or Minimal) or Desktop(or DVD) editions?

In the meantime, can you test using the full path of the installed command?

sudo /usr/local/bin/wiretrustee up --setup-key KEY
@mlsmaycon commented on GitHub (Nov 14, 2021): Ok, thanks for running the checks @pomazanbohdan. I will look into a fix for future releases. Can you confirm if these are default installations of Centos 8 and Rocky Linux 8? Also, are they both Server(or Minimal) or Desktop(or DVD) editions? In the meantime, can you test using the full path of the installed command? ```shell sudo /usr/local/bin/wiretrustee up --setup-key KEY ```
Author
Owner

@pomazanbohdan commented on GitHub (Nov 14, 2021):

Can you confirm if these are default installations of Centos 8 and Rocky Linux 8? Also, are they both Server(or Minimal) or Desktop(or DVD) editions?

Yes, these are basic minimal environments on Hetzner (Rocky linux) and Oracle Cloud (OL)

In the meantime, can you test using the full path of the installed command?

sudo /usr/local/bin/wiretrustee up --setup-key KEY

sudo /usr/local/bin/wiretrustee up --setup-key 5F9D9659-A977-417A-82B2-CBB4B9D7DDCA
Wiretrustee service has been stopped
Wiretrustee service has been started

image

@pomazanbohdan commented on GitHub (Nov 14, 2021): > Can you confirm if these are default installations of Centos 8 and Rocky Linux 8? Also, are they both Server(or Minimal) or Desktop(or DVD) editions? Yes, these are basic minimal environments on Hetzner (Rocky linux) and Oracle Cloud (OL) > In the meantime, can you test using the full path of the installed command? > > ```shell > sudo /usr/local/bin/wiretrustee up --setup-key KEY > ``` sudo /usr/local/bin/wiretrustee up --setup-key 5F9D9659-A977-417A-82B2-CBB4B9D7DDCA Wiretrustee service has been stopped Wiretrustee service has been started ![image](https://user-images.githubusercontent.com/696713/141697581-87698345-078d-456f-8885-47a2d60c920f.png)
Author
Owner

@mlsmaycon commented on GitHub (Nov 14, 2021):

Hi @pomazanbohdan looking closer at the issue, it seems like these systems are using a sudo configuration called secure_path(description below) more restricted than most systems, the defined paths for this setting in Oracle Linux are the ones from your output.

secure_path

Path used for every command run from sudo. If you don't trust the people running sudo to have a sane PATH environment variable you may want to use this. Another use is if you want to have the “root path” be separate from the “user path”. Users in the group specified by the exempt_group option are not affected by secure_path. This option is not set by default.

With that in mind, we are unable to make an effective script that would work transparently without potentially triggering more issues with leftovers or multiple command sources.

An alternative is to use a combination of the which command like the example below or to add the /usr/local/bin in the secure_path definition in the /etc/sudoers file.

Alternative using which:

sudo $(which wiretrustee) version
@mlsmaycon commented on GitHub (Nov 14, 2021): Hi @pomazanbohdan looking closer at the issue, it seems like these systems are using a sudo configuration called **secure_path**(description below) more restricted than most systems, the defined paths for this setting in Oracle Linux are the ones from your output. **secure_path** ```shell Path used for every command run from sudo. If you don't trust the people running sudo to have a sane PATH environment variable you may want to use this. Another use is if you want to have the “root path” be separate from the “user path”. Users in the group specified by the exempt_group option are not affected by secure_path. This option is not set by default. ``` With that in mind, we are unable to make an effective script that would work transparently without potentially triggering more issues with leftovers or multiple command sources. An alternative is to use a combination of the which command like the example below or to add the /usr/local/bin in the **secure_path** definition in the /etc/sudoers file. Alternative using which: ```shell sudo $(which wiretrustee) version ```
Author
Owner

@mlsmaycon commented on GitHub (Oct 29, 2022):

Since we are installing the binary in the /bin/ path, this shouldn't be an issue anymore

@mlsmaycon commented on GitHub (Oct 29, 2022): Since we are installing the binary in the /bin/ path, this shouldn't be an issue anymore
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#80