In: Computer Science
You are to create a hard link to one of your existing files on someone else's directory (or vice versa). In other words, you know that you can link a file within your own directories, but you can also have a link to one of your files on other areas of the unix system as long as you have permissions to write to that directory (in this case, your partner).
Create a subdirectory called temp where you can place this temporary link.
Remember that you do not link a file to another file. You create
a hard link to an existing file.
So, user A has file1 that he/she wants to
give access to user B. User B has to open certain
directory permissions, for this to happen, then User A can
create the link on user B directory (user A NEVER goes to user B
directories typing cd), but if permissions are opened correctly all
the commands will be done from user A directory without shell error
messages such as “can not access..”.
The question? what did you have to do for this work? Describe
ALL the steps showing the commands. Be very precise on these steps.
A person should be able to take step by step described and
accomplish the task of creating a hard link. Make sure to
be precise. I should be able to follow these steps and create the
link (BE COMPLETE). This will be like a recipe, I will need to type
each step and complete this task showing the commands.
step 1. ... user B opened permissions... (show command
chmod ..... )
step 2. ... user A creates a directory and changed permissions,
chmod ...
step 3..
The 2 persons reading the steps will be able to accomplish this task as if they have never done this before. (the first time that you bake a cake, instructions need to be complete and precise to work). It is not a narrative, it is a step by step solution.
I have used ubuntu server to create your scenario.
Step 1 : As a root user (User A) a sample file is available in a
directory (/tmp/test.txt)
Step 2 : Create Hard link using command (ln [original filename]
[link name])
ln test.txt /home/sat/hl - here hl is hard link name of test.txt
file. And we are writing into another user directory (User B)
Step 3 : User B now can able to access this file from User A.
Step 4 : If you delete original file also User B still will be able
to access the content of the file because of Hard link.
Hope this is helpful
Please please upvote if it is helpful it helps me alot and please please dont downvote