Linux Fundamentals

@NightSleuth said:

Type your comment> @TazWake said:

@NightSleuth said:

It won’t let me switch to user htb-student because this user doesn’t exist. So how am I suppose to ssh a machine with this user if it doesn’t exist?

How are you trying to switch to the user? You ssh in as that user account.

I can’t even login to that user in order to ssh with the right user.

I am not sure I understand this.

You don’t login as that user in order to ssh as that user. You login to your system as any user who is valid on your system.

Then you ssh into the box as the htb-student user.

So just to check:

  • you click on the link to spawn the target system and it will give you an IP address.
  • you ssh in with ssh htb-studen@(whatever IP it gave you) and then use the password provided.

If you are tying to switch user before you have SSH’d in, you are trying to switch on your local system.

I have problem with this task ‘What is the name of the hidden “history” file in the htb-user’s home directory?’, can someone give me like some hints or something…

I accessed both target machine’s home and local workstation home, tried most of ls combinations to see hidden files, but actually got nothing…

What am I doing wrong here, and I would be thankful if you can give me some hints.

1 Like

@hajdarevicedin said:

I have problem with this task ‘What is the name of the hidden “history” file in the htb-user’s home directory?’, can someone give me like some hints or something…

I accessed both target machine’s home and local workstation home, tried most of ls combinations to see hidden files, but actually got nothing…

What am I doing wrong here, and I would be thankful if you can give me some hints.

First, it really needs to be on the target machine. HTB can’t know how you have your machine configured so asking questions about it wouldn’t make sense.

Try ls -al and see if anything stands out.

If you are still struggling, try ls -al | grep history and see what that returns.

1 Like

Type your comment> @TazWake said:

@NightSleuth said:

Type your comment> @TazWake said:

@NightSleuth said:

It won’t let me switch to user htb-student because this user doesn’t exist. So how am I suppose to ssh a machine with this user if it doesn’t exist?

How are you trying to switch to the user? You ssh in as that user account.

I can’t even login to that user in order to ssh with the right user.

I am not sure I understand this.

You don’t login as that user in order to ssh as that user. You login to your system as any user who is valid on your system.

Then you ssh into the box as the htb-student user.

So just to check:

  • you click on the link to spawn the target system and it will give you an IP address.
  • you ssh in with ssh htb-studen@(whatever IP it gave you) and then use the password provided.

If you are tying to switch user before you have SSH’d in, you are trying to switch on your local system.

OOhhhh, I didn’t know that that was the sintaxe. I was trying something different. I probably didn’t understand a concept; cause I didn’t really know about the @ and then the IP. I’m still a noob (just for the record). It worked. Thank you though. :slight_smile:

@NightSleuth said:

OOhhhh, I didn’t know that that was the sintaxe. I was trying something different. I probably didn’t understand a concept; cause I didn’t really know about the @ and then the IP. I’m still a noob (just for the record). It worked. Thank you though. :slight_smile:

I am glad to have helped.

Type your comment> @Shieldmaiden said:

I’m sorry that this will be obvious to 99% of you but i’m a noob and i’m currently working on the Linux Fundamentals module. The question asks “What is the path to htb-student’s home directory?” so I put my answer as following: /home/(and my username). It’s saying it’s incorrect but that’s what it told me my home directory was??? The same has happened with the question “What is the name of the network interface that MTU is set to 1500?” and I put the answer: eth0 Because that’s the network it showed MTU set to 1500 but this was also incorrect!!
Please help! (I apologise again if i’m being such a noob lol)

Answer:
Home directory : /home/htb-student
MTU 1500: ens192 (The one on which IP is given, it may change in your turn)

Type your comment> @TazWake said:

@NightSleuth said:

Type your comment> @TazWake said:

@NightSleuth said:

It won’t let me switch to user htb-student because this user doesn’t exist. So how am I suppose to ssh a machine with this user if it doesn’t exist?

How are you trying to switch to the user? You ssh in as that user account.

I can’t even login to that user in order to ssh with the right user.

I am not sure I understand this.

You don’t login as that user in order to ssh as that user. You login to your system as any user who is valid on your system.

Then you ssh into the box as the htb-student user.

So just to check:

  • you click on the link to spawn the target system and it will give you an IP address.
  • you ssh in with ssh htb-studen@(whatever IP it gave you) and then use the password provided.

If you are tying to switch user before you have SSH’d in, you are trying to switch on your local system.

I did the method mentioned above, but after entering ssh htb-student@, the machine just gets stuck and after a few mins it says connection timed out.
I don’t really understand what to do.
Please help me (if it seems dumb I’m sorry)

@luciferc0027 said:

I did the method mentioned above, but after entering ssh htb-student@, the machine just gets stuck and after a few mins it says connection timed out.
I don’t really understand what to do.
Please help me (if it seems dumb I’m sorry)

Ok, some things to check:

  • You clicked the link to spawn the target machine and it gave you an IP address
  • You connect with ssh htb-student@(the IP address it gave you - for example: ssh htb-student@10.10.10.10.

The timing out implies that it cant find the target system - the most likely cause is that it didn’t get spawned correctly.

Hey team…I’ve been trying to find the hidden “history” file in my home directory to do What is the name of the hidden “history” file in the htb-user’s home directory? I’ve tried ls -ash, ls -a1 and just about every other combination I can think of. I get this output: drwxr-xr-x 5 root root 4096 Aug 3 12:08 . drwxr-xr-x 24 root root 4096 Aug 3 12:08 … drwxr-xr-x 6 cry0l1t3 cry0l1t3 4096 Aug 3 12:08 cry0l1t3 drwxr-xr-x 4 htb-student htb-student 4096 Aug 3 12:08 htb-student drwxr-xr-x 6 mrb3n mrb3n 4096 Aug 3 12:08 mrb3n Nothing I’m thinking of seems to work…Can anyone suggest what I’m doing wrong. I have ssh’d to the target machine…but I’m lost Any help is greatly appreciated Thanks All

What you’re showing seems to be /home and not the htb-student’s home directory, which would be located at /home/htb-student. Usually this is the directory you’re placed into when you log in, if not, you can type “cd ~”.

i was trying to run systemctl start ssh but it is asking for a password , i didn’t set one ?

to work with the ssh locally from your machine you need to first connect to htb using vpn.
in the academy question you will see a button saying get vpn keys download the ovpn file.
then from your terminal you can do
sudo openvpn file_name.ovpn
then you are good to go once connected.

if you don’t have openvpn installed in your machine you can install it by doing
sudo apt install openvpn

don’t forget to put the “.” before the word that was my terrible mistake

I am struggling with a question,
What is the path to the htb-student’s mail?
I type ls and ls -a and I don’t the the mail directory, someone have an idea?
Thank you

Try to env | grep Mail it might help

The MTU is The maximum transmission unit, so it´s network stuff, i would suggest check the commands of network :wink:

Ok thanks alot

I am facing the same problem, any updates regarding that?

Try uname -r

First we connect to the instance that gives us to interact or if not, we download the vpn and use the command in the download path of the vpn, usually found in downloads and run it in sudo su "openvpn [here the name of the file that was downloaded].

After that we generate our target that by clicking on the next option will give us the ip address to which we will connect via ssh with the credentials already provided.

Once we have that we use the command "ssh [the user]@[the ip address] and enter, it would look like this in my case:
ssh htb-student@10.129.187.182
therefore we give that if and we provide the password that it provides us, already inside the remote server is that we will begin to look for the answers of the questions.

Find out the hardware name of the machine and send it as an answer.
Here we use the uname command that previously we were taught with the -i parameter that will give us x86_64.

What is the path to the home directory of htb-student?
Here we will use the pwd command which shows you the directory you are working on which displays
/home/htb-student

For the question What version of the kernel is installed on the system (Format: 1.22.3)
Here we use the uname command with the -r switch that will show you the kernel version, remembering the format it would be 4.15.0
4.15.0-123-generic

for the question What is the name of the network interface on which the MTU is set to 1500?
We can use the command ifconfig that will show you network information, it is worth mentioning that MTU are the packages that we send to the internet, there you will see the configuration of MTU A 1500 and ens192 that is the network interface.

for the question What shell is specified for the htb-student user?
We can type in a console:

$ echo $SHELL

we will most likely see the following:

/bin/bash

which indicates that the shell is bash.

For the following question and the previous one there are several ways to solve it, we could navigate between the directories with the commands cd … stop return and cd plus the name where we want to enter to navigate and an ls to list the content, if nothing appears we add -a that will show the directories that begin with a dot . so we can find the path to the mail, but that takes a little time if you do not know where the content can be stored so we can use the following What is the path to the mail of the htb-student?
We can see a list of all our environment variables using the printenv command.
In which we can see the path to the mail and the shell that is specified.
shell

Remember that we can get the answers in different ways, the important thing is to practice and look for the doubts we have in order to learn, I hope it helps.

Translated with DeepL Translate: The world's most accurate translator (free version)

1 Like