How to use a secret password in UE (only server should know it)

Exactly. The game build doesn’t have to include the .txt file at all. It just has to look for it in some location. And on the server you will make sure it’s there. If it’s not found - the request should be skipped.