sorry if I have expressed myself unambiguously. Yes, we use Linux. MFA in Linux and NoMachine works.
To pick up on your sequence, I see it like this (at least for the first login)
Open port 22 for ssh connection
Force mfa creation on first login
login with ssh and create a mfa
logout
than for compliance reason disable port 22
than…
1) start the nomachine connection
2) input your username and password
3) input the Authentication code (from the google authenticator on the mobile app)
i attach a picture from [edited]… that can handle mfa creation in gui…