Using MFA for SSH Connections
mfa can be used to establish connections to target devices using any method this section will provide information on how to configure mfa for ssh connections only users in mfa enabled user groups can use mfa for ssh connections enabling multi factor authentication (mfa) docid\ rz mdb8kufoscu7gl9wn5 admin and users have the qr code, installed the kron pam mobile client application , scanned the qr code with the kron pam mobile client application , and mfa is enabled for the user group that will be using mfa for ssh connections (see sections sending the mfa qr code to users docid\ foxcgsrfkdettlnic4rrk , creating a connection between kron pam and the kron pam mobile client application docid\ tgayn5p3ww98d6agow2ya , enabling multi factor authentication (mfa) docid\ rz mdb8kufoscu7gl9wn5 ) establish an ssh connection to kron pam server run the following commands to set the required parameters in the config file cd /pam/ssh/conf/ vi nsso properties check the configuration file to see if the parameter below is already configured in it if not, add the lines below if there is a hash (#) sign in front of the parameters, delete the hash (#) sign to activate the parameter if the parameter value is false , change it to true to type or add anything in the vi editor, first press the insert button on the keyboard, then type in the necessary line press esc to exit typing mode to save the file press esc, then colon ( ), type in wq! and press enter if you do not want to save the changes to the file, press esc, then colon ( ), then type in q! and press enter nsso connection otp enabled=true nsso otp cache enabled=true nsso otp cache seconds=300 the first parameter enables mfa for ssh connections through kron pam web gui the second parameter sets up otp caching, and the third one sets the cache value to 300 seconds this means that if a user logs in with otp they will not be asked for any new otp for the next 300 seconds, even if they disconnect and connect again after the parameters are set, restart ssh by running the command sudo systemctl restart pam ssh after these settings, a user belonging to an mfa enabled user group will be asked for a token when logging in to an ssh server