Please guide me accordingly if this question is noobish or a kind of duplicate.
I am wondering how to implement this kind of authentication?

I am asking because I’m quite lost and doesn’t know which keywords to search for this. On my mind, I am planning to have this whenever a user wants to access my domain (eg. http://mysite.com and http://mysite.com/tools).
The keywords you are looking for are:
htaccess,htpasswd,.htaccess.(Providing you use apache)
Ultimately you will put a
.htaccessfile in the dir you want to protect, and let it check the requirements with yourhtpasswdfile.For example: on my server I don’t want people seeing my
privatedirectory.Note that
benjaminin the command above ^ is the username which we will use to log in.We’d like the
.htpasswdfile outside our webfolder for some security.Then in my
privatedir I’d put a.htaccessfile that contains this: