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?
punko@punko:~/Documents$ mountpoint/ls
bash: mountpoint/ls: No such file or directory
punko@punko:~/Documents$ mountpoint/ps
bash: mountpoint/ps: No such file or directory
punko@punko:~/Documents$
About my system:
punko@punko:~$ 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
punko@punko:~$
Best Answer
-
if you actually typed what you said in your email you are missing a "/". it sounds like you simply copied to make a new file named "mountpoint" , it does not say mountpoint is a directory. So if you switch directories to somewhere else it cannot work. In other words it should be:
mkdir mountpoint cp /bin/ls mountpoint mountpoint/ls
But if you go somewhere else you have to give the full path as in:
cd /tmp /home/student/mountpoint/ls
or wherever you put it.
5
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.
1
Categories
- All Categories
- 179 LFX Mentorship
- 179 LFX Mentorship: Linux Kernel
- 776 Linux Foundation IT Professional Programs
- 384 Cloud Engineer IT Professional Program
- 175 Advanced Cloud Engineer IT Professional Program
- 76 DevOps IT Professional Program - Discontinued
- 7 DevOps & GitOps IT Professional Program
- 103 Cloud Native Developer IT Professional Program
- 7.7K Training Courses & Learning Paths
- 17 AI & ML Training
- 2 Blockchain & Decentralized Identity Training
- 48 Cloud & Containers Training
- 7 Cybersecurity Training
- 4 DevOps & Site-Reliability Training
- 3 Linux Kernel Development Training
- 3 Networking Training
- 2 Open Source Best Practice Training
- 6 System Administration Training
- 1 System Engineering Training
- 6 Web & Application Development Training
- 798 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 96 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 92 Storage
- 775 Linux Distributions
- 83 Debian
- 68 Fedora
- 24 Linux Mint
- 13 Mageia
- 24 openSUSE
- 151 Red Hat Enterprise
- 32 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 473 Linux System Administration
- 31 Cloud Computing
- 73 Command Line/Scripting
- Github systems admin projects
- 104 Linux Security
- 79 Network Management
- 102 System Management
- 46 Web Management
- 175 Mobile Computing
- 32 Android
- 128 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 407 Off Topic
- 128 Introductions
- 35 Study Material
- 1.1K Programming and Development
- 312 Kernel Development
- 730 Software Development
- 1K Software
- 421 Applications
- 183 Command Line
- 5 Compiling/Installing
- 71 Games
- 320 Installation
- Archived
- 183 Small Talk
- 2 LFD140 Class Forum
- 1.4K LFS258 Class Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)
