There is no secret. It’s always worked fine for me.
It is possible to end up with two different passwords (one Webmin, one system), but that’s not the default; the default is to use system passwords. The changepass.pl command changes the Webmin password, while
passwd changes the system password. If you previously used changepass.pl you may have two different passwords, so you’re perhaps you’re trying to login using the system password, which obviously wouldn’t work, since you’d have a non-system password for Webmin. I recommend just using one.
The Webmin->System->Change Passwords page modifies system passwords (not Webmin passwords). If you change there, and you’ve also set a Webmin password (using changepass.pl or the Webmin->Webmin Users module), you are not changing the password you use to login to Webmin.
Visit Webmin->Webmin->Webmin Users->root
Make sure it is set to “Unix Authentication” rather than anything else. Having two passwords is just confusing you, so don’t do that.