Q:

Keep SFTP Connection Active to Avoid Dual-Factor Reauthentication

I am using WinSCP to connect via SFTP to a Linux server with dual-factor authentication in place. When I connect, I have to confirm the connection on my cell phone. Each file transfer also counts as an individual "connection" and so for each file I have to check my phone and approve the action.
Is there any way to keep the connection "active" so that I am not reconnecting each time I want to do a transfer? This question seems to be similar but is unanswered, and specifically mentions Google dual-factor. (For reference, my server uses Duo Security if that makes a difference.)

A:

You can try using an agent that remembers your credentials, such as Pageant, which is usually installed alongside WinSCP.  Depending on the specific 2FA implementation and what the 2FA is actually protecting, that may or may not fix the issue.
If that doesn't work--which, it probably won't--you're stuck limiting WinSCP to a single connection.  Unfortunately, that's going to limit the functionality of WinSCP somewhat: background transfers will no longer work.  This has a few effects:

You won't be able to browse the filesystem while any upload/download operation is in progress.
SSH operations, such as the shortcuts to create tarballs, will still require a separate connection, meaning you have to authenticate again.
You'll only be able to transfer one file at a time.
You'll only be able to queue one object at a time (file or directory)--that is to say, there is no longer a queue.  Everything takes place in the foreground, and you have to wait for it to finish before proceeding.

To toggle this state, you need to completely disable background transfers.  This isn't quite as straightforward as it could be; there are two places you'll need to adjust settings:

The preferences dialog (Transfer -> Background)
The file transfer dialog at transfer time

Additional useful info on WinSCP website: Transfer Queue
In on the Transfer -> Background preferences page, change the maximum number of simultaneous connection to 1, disable queue processing by default, and make sure any settings related to background transfers are disabled.
At transfer time, you'll see the transfer dialog:

Make sure Transfer on background is unchecked.

A:

Try adjusting the setting "Keepalives" from WinSCP. In the Keepalives box, you may order WinSCP to send some dummy data in regular periods to avoid being disconnected. This period is defined with Seconds between keepalives. Find the full details with screenshots here: http://winscp.net/eng/docs/ui_login_connection 

