Linux Fundamentals

It looks like you are running this on your own system.

At the start of the questions is a bit which says:

Target: Click here to spawn the target system!
 
 SSH to with user "htb-student" and password "HTB_@cademy_stdnt!"

You need to spawn a target and connect to it. Then get the information from that system.

1 Like

thanks for your answer i trying to connect to ssh…
i open my_credentials.txt
take IP on the botton aside target:
then
ssh username@targetip

when it ask password i’m using that i toke in txt file…but is not correct…is it normal?

ok sorry… i figure it out… i so stupid i must ssh with username htb_student…i fell dumb…sorry again… all works fine now

Nice one - it is all about learning.

Hi everyone…I’ve a question, what’s is the difference between:

dpkg -l | wc -l
apt list --installed | wc -l

and why they give me different values ? (748 and 738)
and why if it work dpkg -l, the

dpkg -s 

give me error:
–status needs at least on package name argument

I cannot figure out the right number of installed packages

I find the solution, but I dont understand why apt and dpkg give me different reponse

I found a strange stuff the number of packages change without doing anything

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?

@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.

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’ve tried through ssh and sudo, sudo works between root and the other user, but doesn’t work when I try to switch to htb-student. If I ssh stb-… it won’t work either.

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.

@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 ?