The Dutch Hacker

Linux Fundamentals Part 2

This is a writeup for the room Linux Fundamentals Part 2 on tryhackme

You can read part one here Linux Fundamentals Part 1

Make connection with VPN or use the attackbox on Tryhackme site to connect to the Tryhackme lab enviroment

The Tasks

Task 1:

Press on deploy to deploy the VM connected to this room after reading the task. Press complete on both questions after reading them. No answers are needed. Once deployed make note of the IP as you need it to connect to the machine from your terminal

Linux Fundamentals Part 2 intro task

Task 2:

Read all that is in the task and press complete

Task 3:

Read it and connect to the VM. In the assignment they use a windows machine with putty installed on it and second is by using the ssh command in Windows. This command is the same in Linux. We are using kali Linux from Tryhack. In this case open an terminal and make the connection. Chang the IP to the IP that is provided in the task

Linux Fundamentals Part 2 make an ssh connection

Task 4:

Read the task and note that echo hello >> file2 && cat file2 means put hello into a file called file2 and put the output from file2 on screen. Once done press completed to continue

Linux Fundamentals Part 2 using the echo

Task 5:

Read all that is in the task and press complete

Task 6:

Read the task. The answer of the first question is in the last screenshot. We just need to change the test

export nootnoot=1111

answer task 6

The second answer can also be found in the same screenshot. Let’s put the command echo $HOME in the terminal

Linux Fundamentals Part 2 variable

You can now copy and paste the answer

answer task 6

Task 7:

Read all that is in the task and press complete

Task 8:

Read all that is in the task and press complete

Task 9:

The answer of this question can be found in the last screenshot. You just need to edit the command to fit the question. Also note that > will replace a file if the file is already there

answer task 9

Task 10:

Read the task and press complete, However please remember that >> appends to a file while as we learned in task 9 > overwrite the content

Task 11:

First we need to set the variable test1234 to the same value as $USER

Now use this password to login as shiba3

Linux Fundamentals Part 2 - get next user

For the next tasks use the shiba3 account

Task 12:

Read all that is in the task and press complete

Task 13:

Read all that is in the task and press complete

Task 14:

The answer of the first question can be found in the last screenshot

chown paradox file

ansswer task 14

The answer of the second question can be found in the text after the first screenshot

answer task 14

So for the answer on the 3rd question we type man chown in the terminal to look for the recursive operator

Linux Fundamentals Part 2 man chown
asnwer task 14

Task 15:

Read the task and note the tables

Let’s tear down the first question in order to understand rights

  • User= read
  • group= read and write and
  • All= can not do anything

with this we can take the table and just walk trough it

Linux Fundamentals Part 2 file permissions

And as we have learned 0 is for no rights at all

aswer task 15

Second question

  • User = Read write and execute
  • Group = Read,write and execute
  • All = Read,wrtie and execute
answer task 15

Task 16:

For both answers we type in the terminal man rm

Linux Fundamentals Part 2 manual RM
answer task 16
man page rm
task 16 answer

Task 17:

The answer can be found in the first line of task 17

task 17 answer

Task 18:

Read and press Complete to finish the room

Conclusion of room Linux Fundamentals part 2

We have learned the following commands

  • ssh – Remotely access a machine
  • chown – Edit file permissions
  • chmod – Set different permissions on a file
  • rm – Remove files
  • mv – Move files

We have learned about operators

  • && – and
  • & – run a command in the background
  • $ – denote environment variables
  • | – pipe
  • ; – run multiple command. If first command does not run it will still run the next one after the ;
  • > – Add to a file
  • >> – Append to a file

And we have learned about file permission.

File permissions

Most Popular Post

Sign Up

Signup today for free and be the first to get notified on new updates.
* indicates required

Follow Me

Most Popular Post

Contact Us