Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

trevorpan's avatar

How to enable 2FA with SSH key authentication on laravel envoyer?

Permission denied (keyboard-interactive).

When we are using two methods of authentication on our servers the above error is triggered when pushing code to envoyer.

How do we enable envoyer to allow us to enter this 2FA code?

0 likes
1 reply
trevorpan's avatar
trevorpan
OP
Best Answer
Level 15
/etc/pam.d/sshd
...
# skip one-time password if pushing code from envoyer
auth  sufficient pam_access.so accessfile=/etc/security/access.conf
auth required pam_google_authenticator.so

at bottom of following file:
/etc/security/access.conf
+:ALL:159.65.47.205 // envoyer ip
+:ALL:157.245.120.132 // envoyer ip

That was a painful journey. Hope it helps you ~

Be doubly sure you have these settings right. Don't log out of ssh without checking first.

Please or to participate in this conversation.