I'm looking to send some kind of environment variable using "SCP -o" (or any other file transfer protocol for that matter PSFTP, PSCP, etc).
I currently use SCP to transfer files between Linux/Windows servers. The Linux servers are protected with Duo for Unix. When I use SCP (either WinSCP or SCP CLI), the authentication will hang as I receive a push on my phone. Once I accept the push the authentication will continue and the file will transfer successfully. However, our organization is disabling the push functionality in favor of OTP codes (or other, more secure MFA methods). Duo for Unix accepts OTP codes as an environment variable ($DUO_PASSCODE=58473).
Currently, I can send this variable with the OTP code via SSH using PuTTY (or via CLI with SendEnv=$DUO_PASSCODE=58473). I'm looking to see if there's anyway to accomplish this using either SCP, PSCP, or PSFTP. Any help is appreciated!
scp
andsftp
from OpenSSH support-o
that allows passingSendEnv
to the underlyingssh
.