Answer the question
In order to leave comments, you need to log in
How to integrate some bash commands?
As we all know, there are a number of commands on the command line (Bash): ls, nano, node, webpack, etc. , depending on the particular package. The bottom line is that these spells must be stored somewhere, the question is where?
In my case, I ran into a problem related to the environment of root-a and user-a. In the first case, some commands (necessary for the user) are located and executed under root, otherwise for a simple user, the same commands of simple packages (such as webpack) are not found.
Answer the question
In order to leave comments, you need to log in
These are not spells, but simply executable files.
Bash searches for external commands in the directories listed in the PATH variable ((colon separator)
1. Unlike Windows, bash will not look for a file in the current directory - only in the directories listed in PATH
2. The order matters - the first one found is executed file
3. bash internal commands and alias commands take precedence,
just add the directory with the file you need to your PATH like this:
PATH=$PATH:/new/directory
seems to be different for the root user in the PATH profile than your user.
The bottom line is that these spells must be stored somewhere, the question is where?
1. We learn the mat part of a colleague which ls
2. The commands necessary for the user can be put / usr / bin
3. Also, do not forget about SUID / SGID, which will allow you to store some of the executable files in the root folder BUT will allow them to be executed without entering a password on his behalf . Example ping is a command that affects interfaces but does not require a root password.
4. If this was not enough, then here's another Jailkit
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question