Sitemap

Linux Fundamentals 2 | TryHackMe

4 min readMay 29, 2023

--

This part of the Linux Fundamentals of TryHackMe focuses on new commands and various ways of implementing them as per user’s concern.

Get Rhy’s stories in your inbox

Join Medium for free to get updates from this writer.

The very first thing, we do, is to deploy the attack box machine and then after the loading is completed, we try SSH login on the given IP addressn with the username and password both being “tryhackme”.

ssh tryhackme@{ip_address}
Press enter or click to view image in full size

Then, we move ahead to “ls” command which lists the contents of the working directory. After looking at the ‘man’ page of the ls, answers to the given questions could be solved;

Press enter or click to view image in full size

The answer to the third question in the above figure.

Press enter or click to view image in full size

Moving ahead, we can create a file with the help of ‘touch’ command.

Press enter or click to view image in full size

I then checked the file type of the ‘unknown1’ file by ‘file’ command.

Press enter or click to view image in full size

In order to move any file to a folder, we can use ‘mv’ followed by the file to be moved, followed by the path to the directory where we want to move the file.

Press enter or click to view image in full size

I displayed the output of the ‘myfile’ using the ‘cat’ command and found the first flag.

Press enter or click to view image in full size

We can pass arguments to ls commands like ‘-l’ which gives us the brief about the listing contents. Also, we can see permissions, ownership of just a single file by adding the file name to the ‘ls -l’ command.

From the above image, the owner of the ‘important’ file is ‘owner2’.

Press enter or click to view image in full size

Now, that we know that there are other users as well in the machine, we can switch between users with the use of ‘su’ command and then giving the password of the user.

Press enter or click to view image in full size

I displayed the content of the ‘important’ file by using ‘cat’ command.

Press enter or click to view image in full size

In a linux OS, the log files of the system is in the ‘/var/log’ directory by default.

Press enter or click to view image in full size
Press enter or click to view image in full size

RAM is a volatile memory, which means that it only stores data till it is powered on and washes away when shut down. Likely, the ‘/tmp’ file in Linux also works similar to RAM on computer as it store the data temporarily just until the system is powered on.

Press enter or click to view image in full size

Most of the users have their own home directory with their own name, so does the ‘root’ user. And the home directory of the root user is ‘/root’.

Press enter or click to view image in full size

--

--