The path in unix is a variable which contains the locations for various programs.
If you type in a command like whoami
, the shell looks at all the folders listed in your $PATH.
Go ahead and type which whoami
in your shell. You will see that whoami is likely located in /usr/bin/whoami
.
By having /usr/bin
in your path, it makes it so you can just type whoami
instead of /usr/bin/whoami
. It is kind of like having a shortcut.
The article you are reading shows that git-upload-pack
installs to a location that the shell doesn't automatically look in for executables. You need to add /opt/bin
and /opt/sbin
to your path so the shell can 'find' git-upload-pack
There are multiple ways to add a directory to a path. I prefer to put it in /etc/profile.d however it appears that busy box does not 'look' in that directory. Instead, it will need to be added to the ~/.ssh/environment file. The environment file is parsed when a user connects over ssh to the server.
Step 6
Use a text editor to edit the following file (it likely doesn't exist yet)
/home/<yourUser>/.ssh/environment
Add the following line to /home//.ssh/environment
export PATH=$PATH:/opt/bin:/opt/bin
Then edit the following file (you will need to be root to do this)
/etc/ssh/sshd_config
In that file, you will find the phrase #PermitUserEnvironment no
Remove the comment (#) and change no to yes
Restart your ssh service, or just reboot the whole device.
You can test that it worked, but running the following command
echo $PATH |grep '/opt/bin'
If it returns something, then everything should work.