Vault OTP doesn't work

I have setup vault otp by following SSH Secrets Engine: One-Time SSH Password | Vault - HashiCorp Learn

I am able to successfully generate OTP but when I try to ssh using the OTP, the client doesn’t accept the password “Permission denied (publickey,keyboard-interactive).”

On the vault server $tail -f /var/log/vault-ssh.log - I get the following error

  • OTP not found
    *** Thu Oct 28 12:22:34 2021
    2021/10/28 12:22:34 ==> WARNING: Dev mode is enabled!
    2021/10/28 12:22:34 [INFO] using SSH mount point: ssh
    2021/10/28 12:22:34 [INFO] using namespace:
    2021/10/28 12:22:35 [ERROR]: Error making API request.

Code: 400. Errors:

  • OTP not found

/var/log/auth.log gives me below error
sshd[1171505]: pam_exec(sshd:auth): /usr/local/bin/vault-ssh-helper failed: exit code 1
sshd[1171484]: error: PAM: System error for ubuntu from
I am trying to access a Ubuntu 20.04 machine using OTP

Any idea what could be causing the issue.