Portal: https://www.shiyanlou.com/courses/running
Challenge: Finding Files
Lab Environment:
User name: Shiyanlou
Password: 76036575
Find a File Introduction
There is a very important file (sources.list) but you forget where it is, you vaguely remember it in the/etc/directory, now you want to find out this file, and then set it to be accessible to you, but other users cannot access
Goal
- Locate Sources.list File
- Change the file owner to yourself (Shiyanlou)
- Modify the permissions to only be readable and writable
Tips
Note: If fail does not have any prompt information, please refresh the page
Ideas:
Have told the need to use the command, this time as long as the above objectives to do is good:
1. Locate the Sources.list file
Input command: sudo find/etc/-name sources.list
Easy wrong point is to add sudo otherwise no permission to find. There is no way to put the address with a backslash, there will be errors
2. Change the file owner to yourself (Shiyanlou)
First enter the command: CD/ETC/APT reach the APT directory, then enter the command: LL view the file owner
Then use the command: sudo chown shiyanlou sources.list to change the file owner to Shiyanlou, at which point the owner has changed
3. Modify the permissions to only their own readable writable
I'm going to use the number method, R 4 W 2 x 1
Then the command you need to enter is: chmod sources.list and then look at it and you'll find the task is complete.
Let's submit the result:
Lab Building Linux Basics Getting Started (new) Challenge: Finding Files