Welcome to the Linux Foundation Forum!

42.9. LABS 1 Exercise 42.1: Security and Mount Options

Hi All,

I am trying to understand one part of this lab, but am pretty confused. Step 2 instructs to "Copy an executable file to it from somewhere else on your system and test that it works in the new location." In the solution, we copy /bin/ls to mountpoint with "sudo cp /bin/ls mountpoint". This far I totally follow, but what comes next confuses me:
$ mountpoint/ls

Why does this work?
To test, I then also copied /bin/ps over and ran:
$ mountpoint/ps

This worked, also.
However, when I moved into ~/Documents and tried mountpoint/ls and mountpoint/ps they did not work, why?

[email protected]:~/Documents$ mountpoint/ls
bash: mountpoint/ls: No such file or directory
[email protected]:~/Documents$ mountpoint/ps
bash: mountpoint/ps: No such file or directory
[email protected]:~/Documents$

About my system:
[email protected]:~$ uname -a
Linux punko 4.15.0-124-generic #127-Ubuntu SMP Fri Nov 6 10:54:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[email protected]:~$

Best Answer

Answers

  • Thank you! Tested, and now I understand is as you are just telling the system were to look for the command. That is the path in front, so if you switch from where you initially were when you copied the command, you have to tell the system where the command you want is located. Got it.

Sign In or Register to comment.