lavv17 / lftp

sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)
http://lftp.yar.ru
GNU General Public License v3.0
1.11k stars 162 forks source link

Option -f with 2 factor authentication ->asks for password but not for verification code #744

Open baalkor opened 1 day ago

baalkor commented 1 day ago

Hello,

We've faced recently an issue with lftp. We have people connecting to a SFTP server using password and verification code (pam.d/sshd => google auth). Interactively, when we open a session it works fine :

$> lftp sftp://username@host Password: Verification code

We need to automate the transfert and be able to create a script file containing some download command. For an unkown reason

$> cat test-cmds.txt ls pwd

$> lftp sftp://username@host -f test-cmds.txt Password:

It doesn't ask for the verification code at all and then no connection is done.

We've tested unsucessfully : $> lftp -u username, pass sftp://hosts $> lftp sftp://username@host -e 'set sftp:connect-program "ssh -a -x" $> lftp sftp://username@host -e 'set sftp:connect-program "sftp"

TLDR; Why password and verification codes are both requested in interactive mode while only password is requested in scripting mode (-f). Is there a way we can trigger this verification code request manuall ?

lavv17 commented 1 day ago

AFAIK lftp doesn't ask for verification code at all. It must be a feature of ssh.

Alexander.

On Tue, 19 Nov 2024 at 11:16 baalkor @.***> wrote:

Hello,

We've faced recently an issue with lftp. We have people connecting to a SFTP server using password and verification code (pam.d/sshd => google auth). Interactively, when we open a session it works fine :

$> lftp @.*** Password: Verification code

We need to automate the transfert and be able to create a script file containing some download command. For an unkown reason

$> cat test-cmds.txt ls pwd

$> lftp @.*** -f test-cmds.txt Password:

It doesn't ask for the verification code at all and then no connection is done.

We've tested unsucessfully : $> lftp -u username, pass sftp://hosts $> lftp @. -e 'set sftp:connect-program "ssh -a -x" $> lftp @. -e 'set sftp:connect-program "sftp"

TLDR; Why password and verification codes are both requested in interactive mode while only password is requested in scripting mode (-f). Is there a way we can trigger this verification code request manuall ?

— Reply to this email directly, view it on GitHub https://github.com/lavv17/lftp/issues/744, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHLWXAP7RT22446ERY644T2BLXV7AVCNFSM6AAAAABSBPMOCSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGY3TCMRSGQYTIMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

baalkor commented 22 hours ago

Yes it does.

Le mar. 19 nov. 2024, 12:47, Alexander V. Lukyanov @.***> a écrit :

AFAIK lftp doesn't ask for verification code at all. It must be a feature of ssh.

Alexander.

On Tue, 19 Nov 2024 at 11:16 baalkor @.***> wrote:

Hello,

We've faced recently an issue with lftp. We have people connecting to a SFTP server using password and verification code (pam.d/sshd => google auth). Interactively, when we open a session it works fine :

$> lftp @.*** Password: Verification code

We need to automate the transfert and be able to create a script file containing some download command. For an unkown reason

$> cat test-cmds.txt ls pwd

$> lftp @.*** -f test-cmds.txt Password:

It doesn't ask for the verification code at all and then no connection is done.

We've tested unsucessfully : $> lftp -u username, pass sftp://hosts $> lftp @. -e 'set sftp:connect-program "ssh -a -x" $> lftp @. -e 'set sftp:connect-program "sftp"

TLDR; Why password and verification codes are both requested in interactive mode while only password is requested in scripting mode (-f). Is there a way we can trigger this verification code request manuall ?

— Reply to this email directly, view it on GitHub https://github.com/lavv17/lftp/issues/744, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AAHLWXAP7RT22446ERY644T2BLXV7AVCNFSM6AAAAABSBPMOCSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGY3TCMRSGQYTIMI>

. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/lavv17/lftp/issues/744#issuecomment-2485376500, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABR7ZSKWKZYNCAHIIP4V2632BMQOTAVCNFSM6AAAAABSBPMOCSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBVGM3TMNJQGA . You are receiving this because you authored the thread.Message ID: @.***>