You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found what I believe is a bug with password authentication in
the Net::SFTP::Foreign module. I have attached a minimal example
program to re-produce the bug.
If you specify a password, then by default, the code in
Net::SFTP::Foreign::Backend::Unix::_init_transport() adds the following
options to the ssh(1) command:
It then sends the password to the ssh(1) process only once, since it has
specified only one password prompt. However, if 'keyboard-interactive'
authentication fails due to an INCORRECT PASSWORD, ssh(1) attempts
'password' authentication, issuing a second prompt.
This causes the perl(1) and ssh(1) processes to "hang" or deadlock.
The multiple prompts can be demonstrated by running ssh(1) itself,
and entering an incorrect password:
When specifying a password, specifying the following option to the
Net::SFTP::Foreign contstructor, to override the default value,
works around this bug.
more => [ qw( -o PreferredAuthentications=password ) ]
However, I believe the correct solution is to change the following
line in Net::SFTP::Foreign::Backend::Unix from:
Bug report by Troy Loveday:
I have found what I believe is a bug with password authentication in
the Net::SFTP::Foreign module. I have attached a minimal example
program to re-produce the bug.
Enviroment:
Bug Description:
If you specify a password, then by default, the code in
Net::SFTP::Foreign::Backend::Unix::_init_transport() adds the following
options to the ssh(1) command:
It then sends the password to the ssh(1) process only once, since it has
specified only one password prompt. However, if 'keyboard-interactive'
authentication fails due to an INCORRECT PASSWORD, ssh(1) attempts
'password' authentication, issuing a second prompt.
This causes the perl(1) and ssh(1) processes to "hang" or deadlock.
The multiple prompts can be demonstrated by running ssh(1) itself,
and entering an incorrect password:
Likewise, the (desired) single password prompt is demonstrated by running:
Workaround:
When specifying a password, specifying the following option to the
Net::SFTP::Foreign contstructor, to override the default value,
works around this bug.
more => [ qw( -o PreferredAuthentications=password ) ]
However, I believe the correct solution is to change the following
line in Net::SFTP::Foreign::Backend::Unix from:
push @preferred_authentications, ('keyboard-interactive', 'password');
to:
push @preferred_authentications, 'password';
Demonstration Program:
Please let me know if you require additional information.
The text was updated successfully, but these errors were encountered: