Welcome!
It's easy, just press "Alt+F6" inside HFS. That will create and open a text file (hfs.events). There add the following:
[request]
{.if|{.{.header|User-Agent.}!=ALLOWED_USER_AGENT_NAME.}|{:{.disconnect.}:}.}
Replace the text marked in red (
ALLOWED_USER_AGENT_NAME), by the user agent you want to allow access, for example, if you only want to allow "
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0", you would use this:
[request]
{.if|{.{.header|User-Agent.}!=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0.}|{:{.disconnect.}:}.}
Replace the text marked in green (
request), by "
download", if you want to allow file listing (to anyone), but block downloads that doesn't match the specified user agent.
Cheers,
Leo.-