Here are some optional tasks to practice regex that can help us to handle it better and more efficiently. For all exercises, we will use the /etc/ssh/sshd_config file on our Pwnbox instance

I tried and false, i need some suggestions.

To clarify to others you will need to ssh into the host in Linux Fundamentals in HTB academy.

This took me some research to figure out, but I recommend keeping this tab
grep(1) - Linux manual page open in the background to reference. It’s easier than typing man.
I also used: Learn Regex: A Beginner's Guide — SitePoint
I am no means an expert and if someone more proficient in Linux finds this please correct :grinning:.

  • 1: Use the -v flag in your grep command.
  • 2: Try -e flag
  • 3: Same as 2.
  • 4: Same as 2.
  • 5: Make sure to use .* operator
  • 6: You guessed it. #2

I hope this helps.

Thanks for this!

However, I am left wondering that the phrasing of the questions require a little more filtering:

Q2: “… word that starts with Permit.” (not just containing it)
Q3: “… word ending with Authentication.” (same)
Q5: “… all lines beginning with Password…” (same)

I have been unable to find a solution, but I’m still learning and will hopefully be able to return to this post and update…