How could I provide 2FA code to a ssh prompt?

44 Views Asked by At

I have set up ssh to work with 2FA, and it all works. So when I ssh user@ip, I'm being asked for a verification code: (user@ip) Verification code:

I would like to be able to be able to automatically have this code provided, so something like echo 123456 | ssh user@ip but that doesn't work, I'm still being asked for the verification code.

Any idea if that is possible and how?

0

There are 0 best solutions below