L
L
Lexx Xell2020-09-01 18:24:26
ubuntu
Lexx Xell, 2020-09-01 18:24:26

Where does sudo get PATH?

Faced with strangeness: It is
5f4e670102c26499768166.png

necessary that /home/lexx/bin be everywhere

Everything is written in .bashrc for root.

It is worth adding that two versions of ffmpeg are installed on the system (one from the turnip, the other compiled from the master)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2020-09-01
@LexxXell

sudo doesn't take anywhere, sudo executes some command. By default, the shell of the specified user.
If it is bash, then you watch how bash reads its configuration files - /etc/bash.bashrc, /etc/profile.d
$HOME/.bashrc and others can be called from them in certain cases.
Therefore, study the entire chain in your shell (in case you don't have bash by default, but ksh or zsh) and you can specify PATH in the correct file.
Or do not bother and write the full path to the command

P
pfg21, 2020-09-01
@pfg21

Well, write the full path to the binary that you need.
Even in Windows it works.
sudo -u root /home/lexx/bin/ffmpeg
if the system is allowed to execute files from this path, it will run.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question