One-time password authentication with PAM

This guide explains how to use pam_oath to set up the usage of one-time passwords (OTPs) to authenticate on a system. Any service using PAM for authentication (such as ssh) can use this method.

Note that the clock of the system running the service and the one providing the one-time password must be synchronised.

SSH configuration

In order OTP during password authentication for ssh connections, do the following. Note that authentication using a ssh key will not be affected.

Key generation

In order for a user to be able to use OTP authentication, an entry for them must be set in the users file, with an initial key which must be copied to the application used to generate OTPs.