问题
I'm using Net::FTP::Foreign with password authentication. and I get error about pty and permission error. firstly, cannot connect to pty slave. secondly, Foreign seems not use password authentication mode. IO:Pty is installed. the machine is solaris.
Code:
my %args = (password => 'pwd', user => 'usr', port => 22, more => '-v');
log->info("Starting SFTP...\n");
my $sftp = Net::SFTP::Foreign->new($O->{sftp_server}, %args);
is there any wrong with my script or any configuration issue on my server.
thanks
Log:
warning: TIOCSCTTY failed, slave might not be set as controlling terminal: Inappropriate ioctl for device at /usr/pkgs/Export/US/SunOS5.10_i86pc/lib/perl5/CPAN/i86pc-solaris/IO/Pty.pm line 121. Error: could not connect pty as controlling terminal! ssh: tty: node name or service name not known Uncaught exception from user code: Unable to establish SFTP connection: SSH slave exited unexpectedly with error code 255 at /usr/pkgs/Export/OPS/SunOS5.10_i86pc/cbin/mkt_daily_new_issue_download.pl line 162 at /usr/pkgs/Export/US/SunOS5.10_i86pc/lib/perl5/CPAN/Net/SFTP/Foreign/Common.pm line 103 Net::SFTP::Foreign::Common::die_on_error('Net::SFTP::Foreign=HASH(0x84cfa78)', 'Unable to establish SFTP connection') called at /usr/pkgs/Export/OPS/SunOS5.10_i86pc/cbin/mkt_daily_new_issue_download.pl line 162
来源:https://stackoverflow.com/questions/21087991/perl-sftp-password-authentication-issues-using-netsftpforeign-pyt-error-pe