This is one of those things that comes up every now and then. Each time I have to go digging to remember the right syntax and steps involved.
Not any more! Today I spent a few extra minutes capturing a slightly re-usable script.
I’ll detect if you’re on master for the login creation, or not on master for user creation.
For further customisation you can comment out / tweak lines before running it.