Yedu has asked for the wisdom of the Perl Monks concerning the following question:

Hi All,

I got the Net::SFTP::Foreign module installed and it is being worked fine for the key-exchange sftp set-up. But I need to set it up to have password based authentication where it should take the password that I passed to login.

I have gone through multiple threads on this topic and found that it is somehow possible using IO:Pty module of perl . Below is the command that I found to use.

my $sftp = Net::SFTP::Foreign->new($host, user => $user, password => $ +password,more => [-o => 'PreferredAuthentications=password,keyboard-i +nteractive,***publickey***']);

But here, in the Preferred authentications, the public key is also being passed.

Can anyone please help me on this? what is the public key that is being referred here?

Also, installing IO::Pty along with Net::SFTP::Foreign modules can server my requirement?

Please help.

Thanks and Regards,

Edu

  • Comment on Perl Net::SFTP::Foreign password authentication . No key exchange setup can be done
  • Download Code

Replies are listed 'Best First'.
Re: Perl Net::SFTP::Foreign password authentication . No key exchange setup can be done
by salva (Canon) on Jun 27, 2016 at 15:16 UTC
    Just...
    my $sftp = Net::SFTP::Foreign->new($host, user => $user, password => $password);
    If that doesn't work, enable debugging for both the module and ssh and post here the output:
    $Net::SFTP::Foreign::debug =-1; my $sftp = Net::SFTP::Foreign->new($host, user => $user, password => $password, more => '-vvv');
      I am trying to find the total number of people present in an LDAP group. Can you please help me in getting the count from the LDAP group(based on the DN) using Net::LDAP in Perl? Also, can you please suggest what could be the filter to be applied to get the number of people? Thanks, Edu
        Use the stderr_fh or stderr_discard constructor options to redirect that banner to a file or just discard it respectively.