sduser1
asked on
Connecting to linux server using Net::Telnet module
I am using the below code to connect to the Linux server. I am getting error.
bad match operator: Search pattern not terminated at C:/Subha/eclipse/Perl Automation/ServerConnect.p l line 12
Below is the code.
#!/usr/bin/perl
use warnings;
use strict;
use Net::Telnet;
my $host = "lmmk.com";
my $user = "user";
my $passwd = "pwd";
my $telnet_con = Net::Telnet->new(Host => $host,
Port => 22,
Timeout => 10,
Prompt => '/\$ $');
my $output=$telnet_con->cmd(' ls');
print "$output";
$telnet_con->close;
Please let me know what is wrong with the above code.
Thank you.
bad match operator: Search pattern not terminated at C:/Subha/eclipse/Perl Automation/ServerConnect.p
Below is the code.
#!/usr/bin/perl
use warnings;
use strict;
use Net::Telnet;
my $host = "lmmk.com";
my $user = "user";
my $passwd = "pwd";
my $telnet_con = Net::Telnet->new(Host => $host,
Port => 22,
Timeout => 10,
Prompt => '/\$ $');
my $output=$telnet_con->cmd('
print "$output";
$telnet_con->close;
Please let me know what is wrong with the above code.
Thank you.
ASKER
I have enabled input_log. The file came out empty but I am attaching the dump_log file.
C--Subha-HistoryNotes-dump-log.txt
C--Subha-HistoryNotes-dump-log.txt
I don't see anything obvious in the script that would account for the error message.
Our company has removed telnet from our servers for PCI compliance, but If I can find one which still has it installed, I'll run a test to see if I can duplicate the problem.
Our company has removed telnet from our servers for PCI compliance, but If I can find one which still has it installed, I'll run a test to see if I can duplicate the problem.
ASKER
Just to let you know, the server I am connecting to is SFTP server and also Linux server.
If you're connecting to an SFTP server, why are you using Net::Telnet?
If you're needing to do any file transfers, then you'd be better off using Net::SFTP::Foreign or possibly Net::SSH::Any
If you're needing to do any file transfers, then you'd be better off using Net::SFTP::Foreign or possibly Net::SSH::Any
ASKER
Thank you. Let me try Net::SFTP and get back to you if I see any issues.
If you're connecting from Windows, as you stated in your perlguru thread, and want to try Net::SFTP::Foreign, you'll need to do that under the cygwin environment.
Another opion, which doesn't require cygwin, would be to use the older Net::SFTP module.
Another opion, which doesn't require cygwin, would be to use the older Net::SFTP module.
ASKER
Thank you. I will try Net::SFTP module
ASKER
I am having issues installing NET::SFTP Module.
Can't locate Net/SSH/Perl/Buffer.pm in @INC (you may need to install the Net::SSH::Perl::Buffer module) C:/Perl/site/lib C:/Perl/lib .) at C:/Perl/lib/Net/SFTP/Buffe r.pm line 6.
BEGIN failed--compilation aborted at C:/Perl/lib/Net/SFTP/Buffe r.pm line 6.
Compilation failed in require at C:/Perl/lib/Net/SFTP/Attri butes.pm line 7.
BEGIN failed--compilation aborted at C:/Perl/lib/Net/SFTP/Attri butes.pm line 7.
Compilation failed in require at C:/Perl/lib/Net/SFTP.pm line 8.
BEGIN failed--compilation aborted at C:/Perl/lib/Net/SFTP.pm line 8.
Compilation failed in require at C:/Subha/eclipse/Perl Automation/SFTPServerConne ct.pl line 5.
BEGIN failed--compilation aborted at C:/Subha/eclipse/Perl Automation/SFTPServerConne ct.pl line 5.
Can't locate Net/SSH/Perl/Buffer.pm in @INC (you may need to install the Net::SSH::Perl::Buffer module) C:/Perl/site/lib C:/Perl/lib .) at C:/Perl/lib/Net/SFTP/Buffe
BEGIN failed--compilation aborted at C:/Perl/lib/Net/SFTP/Buffe
Compilation failed in require at C:/Perl/lib/Net/SFTP/Attri
BEGIN failed--compilation aborted at C:/Perl/lib/Net/SFTP/Attri
Compilation failed in require at C:/Perl/lib/Net/SFTP.pm line 8.
BEGIN failed--compilation aborted at C:/Perl/lib/Net/SFTP.pm line 8.
Compilation failed in require at C:/Subha/eclipse/Perl Automation/SFTPServerConne
BEGIN failed--compilation aborted at C:/Subha/eclipse/Perl Automation/SFTPServerConne
This is a common type of error when installing this module. One of the dependencies Net::SFTP requires is Net::SSH::Perl which has a lot of its own dependencies. Some of those dependencies are a pain to install on Windows, but not impossible.
Lookup the Net::SSH::Perl dependencies and build status for your version of perl and install each dependency individually.
Once those are installed, install Net::SSH::Perl and assuming that all goes well, then install Net::SFTP.
The last time I installed Net::SSH::Perl, which was about 5 years ago, I had to install a couple additional modules which were not required dependencies, but were needed to speed up the authentication process.
Lookup the Net::SSH::Perl dependencies and build status for your version of perl and install each dependency individually.
Once those are installed, install Net::SSH::Perl and assuming that all goes well, then install Net::SFTP.
The last time I installed Net::SSH::Perl, which was about 5 years ago, I had to install a couple additional modules which were not required dependencies, but were needed to speed up the authentication process.
ASKER
I was in the process of installing the modules and I am stuck here.
Can't locate loadable object for module Math::Pari in @INC.
Can't locate loadable object for module Math::Pari in @INC (@INC contains: C:/Subha/eclipse/.metadata /.plugins/ org.epic.d ebug C:/Subha/eclipse/Perl Automation C:/Perl/site/lib C:/Perl/lib .) at C:/Perl/lib/Net/SSH/Perl/U til/SSH2MP .pm line 6.
Compilation failed in require at C:/Perl/lib/Net/SSH/Perl/U til/SSH2MP .pm line 6.
BEGIN failed--compilation aborted at C:/Perl/lib/Net/SSH/Perl/U til/SSH2MP .pm line 6.
Compilation failed in require at C:/Perl/lib/Net/SSH/Perl/U til.pm line 56.
BEGIN failed--compilation aborted at C:/Perl/lib/Net/SFTP/Buffe r.pm line 9.
Compilation failed in require at C:/Perl/lib/Net/SFTP/Attri butes.pm line 7.
BEGIN failed--compilation aborted at C:/Perl/lib/Net/SFTP/Attri butes.pm line 7.
Compilation failed in require at C:/Perl/lib/Net/SFTP.pm line 8.
BEGIN failed--compilation aborted at C:/Perl/lib/Net/SFTP.pm line 8.
Can't locate loadable object for module Math::Pari in @INC.
Can't locate loadable object for module Math::Pari in @INC (@INC contains: C:/Subha/eclipse/.metadata
Compilation failed in require at C:/Perl/lib/Net/SSH/Perl/U
BEGIN failed--compilation aborted at C:/Perl/lib/Net/SSH/Perl/U
Compilation failed in require at C:/Perl/lib/Net/SSH/Perl/U
BEGIN failed--compilation aborted at C:/Perl/lib/Net/SFTP/Buffe
Compilation failed in require at C:/Perl/lib/Net/SFTP/Attri
BEGIN failed--compilation aborted at C:/Perl/lib/Net/SFTP/Attri
Compilation failed in require at C:/Perl/lib/Net/SFTP.pm line 8.
BEGIN failed--compilation aborted at C:/Perl/lib/Net/SFTP.pm line 8.
What version of perl are you using and is it 32bit or 64bit?
ASKER
32bit
You should be able to install it via ppm.
Example:
c:\test>ppm install http://www.bribes.org/perl/ppm/Math-Pari.ppd
Example:
c:\test>ppm install http://www.bribes.org/perl/ppm/Math-Pari.ppd
Installing package 'http://www.bribes.org/perl/ppm/Math-Pari.ppd'...
Bytes transferred: 1303124
Use of chdir('') or chdir(undef) as chdir() is deprecated at C:/Strawberry/perl/vendor/lib/PPM.pm line 393.
Files found in blib\arch: installing files in blib\lib into architecture dependent library tree
Installing C:\STRAWB~1\perl\site\lib\auto\Math\ Pari\Pari. dll
Installing C:\STRAWB~1\perl\site\lib\Math\libPA RI.dumb.po d
Installing C:\STRAWB~1\perl\site\lib\Math\libPA RI.pod
Installing C:\STRAWB~1\perl\site\lib\Math\Pari. pm
Installing C:\STRAWB~1\perl\site\lib\Math\PariI nit.pm
What's your status? Were you able to install the modules, or are you still having problems?
Since these modules are a pain to install on Windows using the normal method (i.e., cpan), you should probably use ppm to install pre-compiled binaries from the Bribes repository.
My prior post showed how to use ppm to install the Math::Pari module. You can use the same procedure to install Net::SSH::Perl and Net::SFTP
c:\test>ppm install http://www.bribes.org/perl/ppm/Net-SSH-Perl.ppd
c:\test> ppm install http://www.bribes.org/perl/ppm/Net-SFTP.ppd
Since these modules are a pain to install on Windows using the normal method (i.e., cpan), you should probably use ppm to install pre-compiled binaries from the Bribes repository.
My prior post showed how to use ppm to install the Math::Pari module. You can use the same procedure to install Net::SSH::Perl and Net::SFTP
c:\test>ppm install http://www.bribes.org/perl/ppm/Net-SSH-Perl.ppd
Installing package 'http://www.bribes.org/perl/ppm/Net-SSH-Perl.ppd'...
Bytes transferred: 3188
Use of chdir('') or chdir(undef) as chdir() is deprecated at C:/Strawberry/perl/vendor/lib/PPM.pm line 393.
Installing C:\STRAWB~1\perl\site\lib\Crypt\DH.p m
Bytes transferred: 8177
Use of chdir('') or chdir(undef) as chdir() is deprecated at C:/Strawberry/perl/vendor/lib/PPM.pm line 393.
Files found in blib\arch: installing files in blib\lib into architecture dependent library tree
Installing C:\STRAWB~1\perl\site\lib\auto\Strin g\CRC32\CR C32.dll
Installing C:\STRAWB~1\perl\site\lib\String\CRC 32.pm
Installing C:\STRAWB~1\perl\site\lib\String\CRC 32.pod
Bytes transferred: 71869
Use of chdir('') or chdir(undef) as chdir() is deprecated at C:/Strawberry/perl/vendor/lib/PPM.pm line 393.
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Agent.p m
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Auth.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\AuthMgr .pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Buffer. pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Channel .pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Channel Mgr.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Cipher. pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Comp.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Config. pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Constan ts.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Handle. pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Kex.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Key.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Mac.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Packet. pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\SSH1.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\SSH2.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Util.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Auth\Ch allengeRes ponse.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Auth\Ke yboardInt. pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Auth\Ke yboardInte ractive.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Auth\Pa ssword.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Auth\Pu blicKey.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Auth\Rh osts.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Auth\Rh osts_RSA.p m
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Auth\RS A.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Cipher\ Blowfish.p m
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Cipher\ CBC.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Cipher\ CFB.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Cipher\ DES.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Cipher\ DES3.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Cipher\ IDEA.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Cipher\ RC4.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Comp\Zl ib.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Handle\ SSH1.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Handle\ SSH2.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Kex\DH1 .pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Key\DSA .pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Key\RSA .pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Key\RSA 1.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Subsyst em\Client. pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Subsyst em\Server. pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Util\Au thfile.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Util\Ho sts.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Util\RS A.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Util\SS H1Misc.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Util\SS H1MP.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Util\SS H2MP.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SSH\Pe rl\Util\Te rm.pm
c:\test> ppm install http://www.bribes.org/perl/ppm/Net-SFTP.ppd
Installing package 'http://www.bribes.org/perl/ppm/Net-SFTP.ppd'...
Bytes transferred: 11960
Use of chdir('') or chdir(undef) as chdir() is deprecated at C:/Strawberry/perl/vendor/lib/PPM.pm line 393.
Installing C:\STRAWB~1\perl\site\lib\Net\SFTP.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SFTP\A ttributes. pm
Installing C:\STRAWB~1\perl\site\lib\Net\SFTP\B uffer.pm
Installing C:\STRAWB~1\perl\site\lib\Net\SFTP\C onstants.p m
Installing C:\STRAWB~1\perl\site\lib\Net\SFTP\U til.pm
ASKER
Thanks for all your help.
I am able to install all the modules.
I am using the below code to connect to SFTP server.
Please correct if anything is wrong.
my $sftp = Net::SFTP->new($host,$user ,$passwd);
$sftp->status;
$sftp->get('/fimsdevapp/sa mple.txt', 'c:\sample .txt' ])
I get the error 'Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at C:/Perl/site/lib/Net/SSH/P erl.pm line 111.
The getpwuid function is unimplemented at C:/Perl/site/lib/Net/SSH/P erl/SSH2.p m line 39.
I am able to install all the modules.
I am using the below code to connect to SFTP server.
Please correct if anything is wrong.
my $sftp = Net::SFTP->new($host,$user
$sftp->status;
$sftp->get('/fimsdevapp/sa
I get the error 'Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at C:/Perl/site/lib/Net/SSH/P
The getpwuid function is unimplemented at C:/Perl/site/lib/Net/SSH/P
First step is to set the "HOME" environment variable to fix the "getpwuid function is unimplemented" issue.
This needs to be prior to creating the $sftp object.
When creating the $sftp object, the second parameter should be a hash.
Change:
This needs to be prior to creating the $sftp object.
$ENV{HOME} = 'C:/path/to/your/homedir';
This should also work.$ENV[HOME] = $ENV{USERPROFILE};
When creating the $sftp object, the second parameter should be a hash.
Change:
my $sftp = Net::SFTP->new($host,$user,$passwd);
To:
my $sftp = Net::SFTP->new($host, user => $user, password => $passwd );
ormy %args = ( user => $user, password => $password);
my $sftp = Net::SFTP->new($host, %args);
ASKER
Thank you. I get no errors when I added your code.
Not sure if it is connected to the server as I don't see any errors. I added the print statement but it doesn't print the message 'Connected'
Below is the code.
#!/usr/bin/perl
use warnings;
use strict;
use Net::SFTP;
$ENV{HOME} = $ENV{USERPROFILE};
my $host = 'lmmk.fmr.com';
my $user = "user1";
my $passwd = "pwd";
my $sftp = Net::SFTP->new($host,user => $user, password => $passwd);
print "connected\n";
$sftp->status;
$sftp->get("/fimsdev/SIT/f iles/test/ CLARCH_WI_ 2015-04-29 -08-50-05_ O.csv","c: /CLARCH_WI _2015-04-2 9-08-50-05 _O.csv");
Not sure if it is connected to the server as I don't see any errors. I added the print statement but it doesn't print the message 'Connected'
Below is the code.
#!/usr/bin/perl
use warnings;
use strict;
use Net::SFTP;
$ENV{HOME} = $ENV{USERPROFILE};
my $host = 'lmmk.fmr.com';
my $user = "user1";
my $passwd = "pwd";
my $sftp = Net::SFTP->new($host,user => $user, password => $passwd);
print "connected\n";
$sftp->status;
$sftp->get("/fimsdev/SIT/f
Do you have root access on the box you're connecting to? If so, ssh into it and tail the secure log file while you run the script to confirm that the server is accepting your login.
You probably should enable debug to see if that provides anything helpful.
You probably should enable debug to see if that provides anything helpful.
ASKER
Enabled debug and here is the debug log.
LA973353: Reading configuration data C:\Users\a414475/.ssh/conf ig
LA973353: Reading configuration data /etc/ssh_config
LA973353: Connecting to lmmk120.fmr.com, port 22.
LA973353: Remote version string: SSH-2.0-OpenSSH_5.3
LA973353: Remote protocol version 2.0, remote software version OpenSSH_5.3
LA973353: Net::SSH::Perl Version 1.38, protocol version 2.0.
LA973353: No compat match: OpenSSH_5.3
.
LA973353: Connection established.
LA973353: Sent key-exchange init (KEXINIT), wait response.
LA973353: Algorithms, c->s: 3des-cbc hmac-sha1 none
LA973353: Algorithms, s->c: 3des-cbc hmac-sha1 none
LA973353: Entering Diffie-Hellman Group 1 key exchange.
LA973353: Sent DH public key, waiting for reply.
LA973353: Received host key, type 'ssh-dss'.
LA973353: Host 'lmmk120.fmr.com' is known and matches the host key.
LA973353: Computing shared secret key.
LA973353: Verifying server signature.
LA973353: Waiting for NEWKEYS message.
LA973353: Send NEWKEYS.
LA973353: Enabling encryption/MAC/compression .
LA973353: Sending request for user-authentication service.
LA973353: Service accepted: ssh-userauth.
LA973353: Trying empty user-authentication request.
LA973353: Authentication methods that can continue: publickey,password.
LA973353: Next method to try is publickey.
LA973353: Next method to try is password.
LA973353: Trying password authentication.
LA973353: Login completed, opening dummy shell channel.
LA973353: channel 0: new [client-session]
LA973353: Requesting channel_open for channel 0.
LA973353: channel 0: open confirm rwindow 0 rmax 32768
LA973353: channel 1: new [client-session]
LA973353: Requesting channel_open for channel 1.
LA973353: Sending subsystem: sftp
LA973353: Requesting service subsystem on channel 1.
LA973353: channel 1: open confirm rwindow 0 rmax 32768
LA973353: sftp: Sending SSH2_FXP_INIT
LA973353: Reading configuration data C:\Users\a414475/.ssh/conf
LA973353: Reading configuration data /etc/ssh_config
LA973353: Connecting to lmmk120.fmr.com, port 22.
LA973353: Remote version string: SSH-2.0-OpenSSH_5.3
LA973353: Remote protocol version 2.0, remote software version OpenSSH_5.3
LA973353: Net::SSH::Perl Version 1.38, protocol version 2.0.
LA973353: No compat match: OpenSSH_5.3
.
LA973353: Connection established.
LA973353: Sent key-exchange init (KEXINIT), wait response.
LA973353: Algorithms, c->s: 3des-cbc hmac-sha1 none
LA973353: Algorithms, s->c: 3des-cbc hmac-sha1 none
LA973353: Entering Diffie-Hellman Group 1 key exchange.
LA973353: Sent DH public key, waiting for reply.
LA973353: Received host key, type 'ssh-dss'.
LA973353: Host 'lmmk120.fmr.com' is known and matches the host key.
LA973353: Computing shared secret key.
LA973353: Verifying server signature.
LA973353: Waiting for NEWKEYS message.
LA973353: Send NEWKEYS.
LA973353: Enabling encryption/MAC/compression
LA973353: Sending request for user-authentication service.
LA973353: Service accepted: ssh-userauth.
LA973353: Trying empty user-authentication request.
LA973353: Authentication methods that can continue: publickey,password.
LA973353: Next method to try is publickey.
LA973353: Next method to try is password.
LA973353: Trying password authentication.
LA973353: Login completed, opening dummy shell channel.
LA973353: channel 0: new [client-session]
LA973353: Requesting channel_open for channel 0.
LA973353: channel 0: open confirm rwindow 0 rmax 32768
LA973353: channel 1: new [client-session]
LA973353: Requesting channel_open for channel 1.
LA973353: Sending subsystem: sftp
LA973353: Requesting service subsystem on channel 1.
LA973353: channel 1: open confirm rwindow 0 rmax 32768
LA973353: sftp: Sending SSH2_FXP_INIT
ASKER
Looks like the script is hanging at the line sftp: Sending SSH2_FXP_INIT
I've been running some tests and I'm hanging at that point as well. I have not found the cause/solution yet, but will do some more testing.
So far, my research indicates that the best solution is switch to Net::SFTP::Foreign. However, if you do that, you should use ssh keys instead of the password authentication. The password auth will require the use of IO::Pty and on Windows that module only works under the cygwin environment.
So far, my research indicates that the best solution is switch to Net::SFTP::Foreign. However, if you do that, you should use ssh keys instead of the password authentication. The password auth will require the use of IO::Pty and on Windows that module only works under the cygwin environment.
ASKER
Thanks for your help. I installed NET::SFTP::Foreign and I used the below to connect
use Net::SFTP::Foreign;
my $sftp = Net::SFTP::Foreign->new($host);
$sftp->die_on_error("Unabl e to establish SFTP connection");
$sftp->setcwd('/fimsdev/cl ientWorkit emArchive/ test') or die "unable to change cwd: " . $sftp->error;
I am getting ''ssh' is not recognized as an internal or external command,'
Please let me know how to install ssh.
use Net::SFTP::Foreign;
my $sftp = Net::SFTP::Foreign->new($host);
$sftp->die_on_error("Unabl
$sftp->setcwd('/fimsdev/cl
I am getting ''ssh' is not recognized as an internal or external command,'
Please let me know how to install ssh.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,
Thank you. I am able to use the above code and connect to the server. I got the list of files.
I was on vacation on Friday and could not respond to this email.. Thanks for your help.
Thank you. I am able to use the above code and connect to the server. I got the list of files.
I was on vacation on Friday and could not respond to this email.. Thanks for your help.
Start with enabling input_log and if needed, you can enable output_log and/or dump_log