ssh-sftp-perl-users Mailing List for Net::SSH and Net::SFTP - Perl modules (Page 16)
Brought to you by:
dbrobins
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(4) |
Feb
(15) |
Mar
(13) |
Apr
(8) |
May
(5) |
Jun
(21) |
Jul
(4) |
Aug
(9) |
Sep
(11) |
Oct
(14) |
Nov
(15) |
Dec
(24) |
2005 |
Jan
(10) |
Feb
(20) |
Mar
(16) |
Apr
(10) |
May
(12) |
Jun
(16) |
Jul
(18) |
Aug
(21) |
Sep
(11) |
Oct
(19) |
Nov
(16) |
Dec
(9) |
2006 |
Jan
(17) |
Feb
(32) |
Mar
(60) |
Apr
(21) |
May
(24) |
Jun
(1) |
Jul
(6) |
Aug
(18) |
Sep
(4) |
Oct
(9) |
Nov
(31) |
Dec
(10) |
2007 |
Jan
(8) |
Feb
(11) |
Mar
(3) |
Apr
(7) |
May
(4) |
Jun
(6) |
Jul
(7) |
Aug
(3) |
Sep
(2) |
Oct
(5) |
Nov
(5) |
Dec
(5) |
2008 |
Jan
(12) |
Feb
(5) |
Mar
(7) |
Apr
(4) |
May
(37) |
Jun
(9) |
Jul
(24) |
Aug
(5) |
Sep
(2) |
Oct
(7) |
Nov
(6) |
Dec
(7) |
2009 |
Jan
(18) |
Feb
(9) |
Mar
(14) |
Apr
(14) |
May
(1) |
Jun
(14) |
Jul
(4) |
Aug
(6) |
Sep
(4) |
Oct
(12) |
Nov
(4) |
Dec
|
2010 |
Jan
|
Feb
(3) |
Mar
|
Apr
(1) |
May
(4) |
Jun
|
Jul
(6) |
Aug
(6) |
Sep
|
Oct
(7) |
Nov
(2) |
Dec
(5) |
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
(8) |
Jun
(1) |
Jul
|
Aug
(2) |
Sep
|
Oct
(4) |
Nov
(9) |
Dec
(7) |
2012 |
Jan
(1) |
Feb
(19) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
(5) |
Jul
(3) |
Aug
(1) |
Sep
|
Oct
|
Nov
(6) |
Dec
|
2014 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Wolfgang F. <wf...@un...> - 2007-05-23 13:48:12
|
Hi List, reading this list(archive) and the CPAN documentation for Net::SSH2 i was able to get scp, exec and the shell functionality to work, but i have no clue how to get the tcpip and listen functions to work. I want to open a tcp-forwarding, with the listening side on the server and the destination on the client-localhost side (where the perl code is running) , i think the listen function can do this but i don=C2=B4t know ho= w to set the parameters. The documentation on CPAN does not make sense to me also it is very short. does any body use the tcpip and listen features of Net:SSH2 and is willing to send the list and me, some examples and code snippets please. thanks ... --=20 Wolfgang Freller email:wf...@un... underground_8 - secure computing gmbh 4040 Linz, Freist=C3=A4dterstra=C3=9Fe 313, Austria Firmenbuch: 277686m Landesgericht Linz =09 |
From: Heinz P. <hei...@as...> - 2007-05-01 06:08:35
|
Hi, with my $cmd = "testprog.pl"; my $ssh = Net::SSH::Perl->new($ip, debug=>'0', interactive=>'0'); $ssh->login($user, $password); ($stdout , $stderr, $exit) = $ssh->cmd($cmd); print $stdout; I can execute testprog.pl: select STDOUT; $| = 1; print "Programmablauf "; for my $i(0..100) { sleep(1); printf "%3d \%\b\b\b\b\b", $i; } print "Fertig!\n"; on a remote machine. This works fine, but of course I get only the finally output "Programmablauf Fertig!". Is it possible to see the whole output from testprog.pl on my local STDOUT? Thanks |
From: Pierrick LE G. <pie...@le...> - 2007-04-17 16:52:21
|
Hi, Using Net::SSH2 I would like to get the exit status of my last remote command, how can I do this? I've read Net::SSH2::Channel perldoc several times but no example is given, and I really need one. The following code sample does not work: my $chan = $ssh2->channel(); $chan->ext_data('merge'); $chan->shell(); print $chan 'perl /home/z0rglub/work/talend/outerr2.pl; echo $?', "\n"; @output = map {chomp; $_} <$chan>; $exit_status = $chan->exit_status(); print join("\n", map {'command 1: '.$_} @output), "\n"; print '$exit_status: ', $exit_status, "\n\n"; The output is: command 1: warning 1 command 1: warning 2 command 1: salut 1 command 1: 10 $exit_status: 0 And of course, I would like the $exit_status to be 10. Bye -- Pierrick LE GALL R&D engineer at Talend, Open data solution http://www.talend.com |
From: Pierrick LE G. <pie...@le...> - 2007-04-17 16:15:12
|
Hi, Using Net::SSH2 (which seems to be the official SSH client nowadays) I would like to read STDERR separately from STDOUT, how can I do this? I've read Net::SSH2::Channel perldoc several times but no example is given, and I really need one. Bye -- Pierrick LE GALL R&D engineer at Talend, Open data solution http://www.talend.com |
From: John D. <jd...@lo...> - 2007-04-16 21:54:59
|
I figured out this problem. It was actually an issue with Net::SSH::Perl and Crypt::DH. The answer can be found at this link. http://www.cpanforum.com/threads/2689 _____ From: ssh...@li... [mailto:ssh...@li...] On Behalf Of John Dyer Sent: Monday, April 16, 2007 2:08 PM To: ssh...@li... Subject: [Ssh-sftp-perl-users] Net::SFTP occasional segmentation fault I tried posting this before, but not sure it got through. I can't find it in the archive. Any help would be greatly appreciated. _____ From: John Dyer [mailto:jd...@lo...] Sent: Thursday, April 12, 2007 11:30 AM To: 'ssh...@li...' Subject: Net::SFTP occasional segmentation fault HI, I have been trying to get SFTP going in a perl script but not having much luck, so to simplify matters, I have been trying to connect using the psftp client, but I am getting the same results. The odd thing is that the seg fault happens most of the time when I launch psftp from a command line, but occasionally I get a little further before getting a permission denied error. If I run it through the perl debugger, I never get the seg fault. Below are some sample outputs. This is what it looks like from the command line: ---------------------------------------------------------------------------- --------------------- [jdyer@homer bin]$ psftp -v localhost Connecting to localhost... homer.somesite.com: Reading configuration data /home/jdyer/.ssh/config homer.somesite.com: Reading configuration data /etc/ssh_config homer.somesite.com: Connecting to localhost, port 22. homer.somesite.com: Remote version string: SSH-1.99-OpenSSH_3.4p1 homer.somesite.com: Remote protocol version 1.99, remote software version OpenSSH_3.4p1 homer.somesite.com: Net::SSH::Perl Version 1.30, protocol version 2.0. homer.somesite.com: No compat match: OpenSSH_3.4p1. homer.somesite.com: Connection established. homer.somesite.com: Sent key-exchange init (KEXINIT), wait response. homer.somesite.com: Algorithms, c->s: 3des-cbc hmac-sha1 none homer.somesite.com: Algorithms, s->c: 3des-cbc hmac-sha1 none Segmentation fault ---------------------------------------------------------------------------- --------------------- This is the debugger output: ---------------------------------------------------------------------------- --------------------- [jdyer@homer bin]$ perl -d psftp -v localhost Default die handler restored. Loading DB routines from perl5db.pl version 1.07 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(psftp:9): my %opts; DB<1> r Connecting to localhost... homer.somesite.com: Reading configuration data /home/jdyer/.ssh/config homer.somesite.com: Reading configuration data /etc/ssh_config homer.somesite.com: Connecting to localhost, port 22. homer.somesite.com: Remote version string: SSH-1.99-OpenSSH_3.4p1 homer.somesite.com: Remote protocol version 1.99, remote software version OpenSSH_3.4p1 homer.somesite.com: Net::SSH::Perl Version 1.30, protocol version 2.0. homer.somesite.com: No compat match: OpenSSH_3.4p1. homer.somesite.com: Connection established. homer.somesite.com: Sent key-exchange init (KEXINIT), wait response. homer.somesite.com: Algorithms, c->s: 3des-cbc hmac-sha1 none homer.somesite.com: Algorithms, s->c: 3des-cbc hmac-sha1 none homer.somesite.com: Entering Diffie-Hellman Group 1 key exchange. homer.somesite.com: Sent DH public key, waiting for reply. homer.somesite.com: Received host key, type 'ssh-dss'. homer.somesite.com: Host 'localhost' is known and matches the host key. homer.somesite.com: Computing shared secret key. homer.somesite.com: Verifying server signature. homer.somesite.com: Waiting for NEWKEYS message. homer.somesite.com: Enabling incoming encryption/MAC/compression. homer.somesite.com: Send NEWKEYS, enable outgoing encryption/MAC/compression. homer.somesite.com: Sending request for user-authentication service. homer.somesite.com: Service accepted: ssh-userauth. homer.somesite.com: Trying empty user-authentication request. homer.somesite.com: Authentication methods that can continue: publickey,password,keyboard-interactive. homer.somesite.com: Next method to try is publickey. homer.somesite.com: Next method to try is password. homer.somesite.com: Trying password authentication. homer.somesite.com: Will not query passphrase in batch mode. homer.somesite.com: Authentication methods that can continue: publickey,password,keyboard-interactive. homer.somesite.com: Next method to try is publickey. homer.somesite.com: Next method to try is password. homer.somesite.com: Trying password authentication. homer.somesite.com: Will not query passphrase in batch mode. homer.somesite.com: Authentication methods that can continue: publickey,password,keyboard-interactive. homer.somesite.com: Next method to try is publickey. homer.somesite.com: Next method to try is password. homer.somesite.com: Trying password authentication. homer.somesite.com: Will not query passphrase in batch mode. homer.somesite.com: Authentication methods that can continue: publickey,password,keyboard-interactive. homer.somesite.com: Next method to try is publickey. homer.somesite.com: Next method to try is password. Permission denied at /usr/lib/perl5/site_perl/5.6.1/Net/SFTP.pm line 37 Debugged program terminated. Use q to quit or R to restart, use O inhibit_exit to avoid stopping after program termination, h q, h R or h O to get additional info. DB<1> I am on perl 5.6.1 and I have tried versions 0.10 and 0.08 of Net::SFTP with the same results. Any help would be greatly appreciated. Thanks, John |
From: John D. <jd...@lo...> - 2007-04-16 19:08:57
|
I tried posting this before, but not sure it got through. I can't find it in the archive. Any help would be greatly appreciated. _____ From: John Dyer [mailto:jd...@lo...] Sent: Thursday, April 12, 2007 11:30 AM To: 'ssh...@li...' Subject: Net::SFTP occasional segmentation fault HI, I have been trying to get SFTP going in a perl script but not having much luck, so to simplify matters, I have been trying to connect using the psftp client, but I am getting the same results. The odd thing is that the seg fault happens most of the time when I launch psftp from a command line, but occasionally I get a little further before getting a permission denied error. If I run it through the perl debugger, I never get the seg fault. Below are some sample outputs. This is what it looks like from the command line: ---------------------------------------------------------------------------- --------------------- [jdyer@homer bin]$ psftp -v localhost Connecting to localhost... homer.somesite.com: Reading configuration data /home/jdyer/.ssh/config homer.somesite.com: Reading configuration data /etc/ssh_config homer.somesite.com: Connecting to localhost, port 22. homer.somesite.com: Remote version string: SSH-1.99-OpenSSH_3.4p1 homer.somesite.com: Remote protocol version 1.99, remote software version OpenSSH_3.4p1 homer.somesite.com: Net::SSH::Perl Version 1.30, protocol version 2.0. homer.somesite.com: No compat match: OpenSSH_3.4p1. homer.somesite.com: Connection established. homer.somesite.com: Sent key-exchange init (KEXINIT), wait response. homer.somesite.com: Algorithms, c->s: 3des-cbc hmac-sha1 none homer.somesite.com: Algorithms, s->c: 3des-cbc hmac-sha1 none Segmentation fault ---------------------------------------------------------------------------- --------------------- This is the debugger output: ---------------------------------------------------------------------------- --------------------- [jdyer@homer bin]$ perl -d psftp -v localhost Default die handler restored. Loading DB routines from perl5db.pl version 1.07 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(psftp:9): my %opts; DB<1> r Connecting to localhost... homer.somesite.com: Reading configuration data /home/jdyer/.ssh/config homer.somesite.com: Reading configuration data /etc/ssh_config homer.somesite.com: Connecting to localhost, port 22. homer.somesite.com: Remote version string: SSH-1.99-OpenSSH_3.4p1 homer.somesite.com: Remote protocol version 1.99, remote software version OpenSSH_3.4p1 homer.somesite.com: Net::SSH::Perl Version 1.30, protocol version 2.0. homer.somesite.com: No compat match: OpenSSH_3.4p1. homer.somesite.com: Connection established. homer.somesite.com: Sent key-exchange init (KEXINIT), wait response. homer.somesite.com: Algorithms, c->s: 3des-cbc hmac-sha1 none homer.somesite.com: Algorithms, s->c: 3des-cbc hmac-sha1 none homer.somesite.com: Entering Diffie-Hellman Group 1 key exchange. homer.somesite.com: Sent DH public key, waiting for reply. homer.somesite.com: Received host key, type 'ssh-dss'. homer.somesite.com: Host 'localhost' is known and matches the host key. homer.somesite.com: Computing shared secret key. homer.somesite.com: Verifying server signature. homer.somesite.com: Waiting for NEWKEYS message. homer.somesite.com: Enabling incoming encryption/MAC/compression. homer.somesite.com: Send NEWKEYS, enable outgoing encryption/MAC/compression. homer.somesite.com: Sending request for user-authentication service. homer.somesite.com: Service accepted: ssh-userauth. homer.somesite.com: Trying empty user-authentication request. homer.somesite.com: Authentication methods that can continue: publickey,password,keyboard-interactive. homer.somesite.com: Next method to try is publickey. homer.somesite.com: Next method to try is password. homer.somesite.com: Trying password authentication. homer.somesite.com: Will not query passphrase in batch mode. homer.somesite.com: Authentication methods that can continue: publickey,password,keyboard-interactive. homer.somesite.com: Next method to try is publickey. homer.somesite.com: Next method to try is password. homer.somesite.com: Trying password authentication. homer.somesite.com: Will not query passphrase in batch mode. homer.somesite.com: Authentication methods that can continue: publickey,password,keyboard-interactive. homer.somesite.com: Next method to try is publickey. homer.somesite.com: Next method to try is password. homer.somesite.com: Trying password authentication. homer.somesite.com: Will not query passphrase in batch mode. homer.somesite.com: Authentication methods that can continue: publickey,password,keyboard-interactive. homer.somesite.com: Next method to try is publickey. homer.somesite.com: Next method to try is password. Permission denied at /usr/lib/perl5/site_perl/5.6.1/Net/SFTP.pm line 37 Debugged program terminated. Use q to quit or R to restart, use O inhibit_exit to avoid stopping after program termination, h q, h R or h O to get additional info. DB<1> I am on perl 5.6.1 and I have tried versions 0.10 and 0.08 of Net::SFTP with the same results. Any help would be greatly appreciated. Thanks, John |
From: Good T. <aa...@rd...> - 2007-04-12 16:45:38
|
can you run it using strace? strace psftp -v localhost i'd be curious to see what it was doing (from a system call point of view) when it fails aaron -- I think to the general public, The Cure is Robert Smith and a bunch of blokes. -Robert Smith -The Cure On Thu, Apr 12, 2007 at 11:29:36AM -0500, John Dyer wrote: > HI, > > I have been trying to get SFTP going in a perl script but not having much > luck, so to simplify matters, I have been trying to connect using the psftp > client, but I am getting the same results. The odd thing is that the seg > fault happens most of the time when I launch psftp from a command line, but > occasionally I get a little further before getting a permission denied > error. If I run it through the perl debugger, I never get the seg fault. > Below are some sample outputs. > > > > This is what it looks like from the command line: > > > > ---------------------------------------------------------------------------- > --------------------- > > > > [jdyer@homer bin]$ psftp -v localhost > > Connecting to localhost... > > homer.somesite.com: Reading configuration data /home/jdyer/.ssh/config > > homer.somesite.com: Reading configuration data /etc/ssh_config > > homer.somesite.com: Connecting to localhost, port 22. > > homer.somesite.com: Remote version string: SSH-1.99-OpenSSH_3.4p1 > > > > homer.somesite.com: Remote protocol version 1.99, remote software version > OpenSSH_3.4p1 > > homer.somesite.com: Net::SSH::Perl Version 1.30, protocol version 2.0. > > homer.somesite.com: No compat match: OpenSSH_3.4p1. > > homer.somesite.com: Connection established. > > homer.somesite.com: Sent key-exchange init (KEXINIT), wait response. > > homer.somesite.com: Algorithms, c->s: 3des-cbc hmac-sha1 none > > homer.somesite.com: Algorithms, s->c: 3des-cbc hmac-sha1 none > > Segmentation fault > > > > ---------------------------------------------------------------------------- > --------------------- > > > > > > > > This is the debugger output: > > > > ---------------------------------------------------------------------------- > --------------------- > > > > [jdyer@homer bin]$ perl -d psftp -v localhost > > Default die handler restored. > > > > Loading DB routines from perl5db.pl version 1.07 > > Editor support available. > > > > Enter h or `h h' for help, or `man perldebug' for more help. > > > > main::(psftp:9): my %opts; > > DB<1> r > > Connecting to localhost... > > homer.somesite.com: Reading configuration data /home/jdyer/.ssh/config > > homer.somesite.com: Reading configuration data /etc/ssh_config > > homer.somesite.com: Connecting to localhost, port 22. > > homer.somesite.com: Remote version string: SSH-1.99-OpenSSH_3.4p1 > > > > homer.somesite.com: Remote protocol version 1.99, remote software version > OpenSSH_3.4p1 > > homer.somesite.com: Net::SSH::Perl Version 1.30, protocol version 2.0. > > homer.somesite.com: No compat match: OpenSSH_3.4p1. > > homer.somesite.com: Connection established. > > homer.somesite.com: Sent key-exchange init (KEXINIT), wait response. > > homer.somesite.com: Algorithms, c->s: 3des-cbc hmac-sha1 none > > homer.somesite.com: Algorithms, s->c: 3des-cbc hmac-sha1 none > > homer.somesite.com: Entering Diffie-Hellman Group 1 key exchange. > > homer.somesite.com: Sent DH public key, waiting for reply. > > homer.somesite.com: Received host key, type 'ssh-dss'. > > homer.somesite.com: Host 'localhost' is known and matches the host key. > > homer.somesite.com: Computing shared secret key. > > homer.somesite.com: Verifying server signature. > > homer.somesite.com: Waiting for NEWKEYS message. > > homer.somesite.com: Enabling incoming encryption/MAC/compression. > > homer.somesite.com: Send NEWKEYS, enable outgoing > encryption/MAC/compression. > > homer.somesite.com: Sending request for user-authentication service. > > homer.somesite.com: Service accepted: ssh-userauth. > > homer.somesite.com: Trying empty user-authentication request. > > homer.somesite.com: Authentication methods that can continue: > publickey,password,keyboard-interactive. > > homer.somesite.com: Next method to try is publickey. > > homer.somesite.com: Next method to try is password. > > homer.somesite.com: Trying password authentication. > > homer.somesite.com: Will not query passphrase in batch mode. > > homer.somesite.com: Authentication methods that can continue: > publickey,password,keyboard-interactive. > > homer.somesite.com: Next method to try is publickey. > > homer.somesite.com: Next method to try is password. > > homer.somesite.com: Trying password authentication. > > homer.somesite.com: Will not query passphrase in batch mode. > > homer.somesite.com: Authentication methods that can continue: > publickey,password,keyboard-interactive. > > homer.somesite.com: Next method to try is publickey. > > homer.somesite.com: Next method to try is password. > > homer.somesite.com: Trying password authentication. > > homer.somesite.com: Will not query passphrase in batch mode. > > homer.somesite.com: Authentication methods that can continue: > publickey,password,keyboard-interactive. > > homer.somesite.com: Next method to try is publickey. > > homer.somesite.com: Next method to try is password. > > Permission denied at /usr/lib/perl5/site_perl/5.6.1/Net/SFTP.pm line 37 > > Debugged program terminated. Use q to quit or R to restart, > > use O inhibit_exit to avoid stopping after program termination, > > h q, h R or h O to get additional info. > > DB<1> > > > > > > > > I am on perl 5.6.1 and I have tried versions 0.10 and 0.08 of Net::SFTP with > the same results. Any help would be greatly appreciated. > > > > Thanks, > > John > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |
From: John D. <jd...@lo...> - 2007-04-12 16:30:32
|
HI, I have been trying to get SFTP going in a perl script but not having much luck, so to simplify matters, I have been trying to connect using the psftp client, but I am getting the same results. The odd thing is that the seg fault happens most of the time when I launch psftp from a command line, but occasionally I get a little further before getting a permission denied error. If I run it through the perl debugger, I never get the seg fault. Below are some sample outputs. This is what it looks like from the command line: ---------------------------------------------------------------------------- --------------------- [jdyer@homer bin]$ psftp -v localhost Connecting to localhost... homer.somesite.com: Reading configuration data /home/jdyer/.ssh/config homer.somesite.com: Reading configuration data /etc/ssh_config homer.somesite.com: Connecting to localhost, port 22. homer.somesite.com: Remote version string: SSH-1.99-OpenSSH_3.4p1 homer.somesite.com: Remote protocol version 1.99, remote software version OpenSSH_3.4p1 homer.somesite.com: Net::SSH::Perl Version 1.30, protocol version 2.0. homer.somesite.com: No compat match: OpenSSH_3.4p1. homer.somesite.com: Connection established. homer.somesite.com: Sent key-exchange init (KEXINIT), wait response. homer.somesite.com: Algorithms, c->s: 3des-cbc hmac-sha1 none homer.somesite.com: Algorithms, s->c: 3des-cbc hmac-sha1 none Segmentation fault ---------------------------------------------------------------------------- --------------------- This is the debugger output: ---------------------------------------------------------------------------- --------------------- [jdyer@homer bin]$ perl -d psftp -v localhost Default die handler restored. Loading DB routines from perl5db.pl version 1.07 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(psftp:9): my %opts; DB<1> r Connecting to localhost... homer.somesite.com: Reading configuration data /home/jdyer/.ssh/config homer.somesite.com: Reading configuration data /etc/ssh_config homer.somesite.com: Connecting to localhost, port 22. homer.somesite.com: Remote version string: SSH-1.99-OpenSSH_3.4p1 homer.somesite.com: Remote protocol version 1.99, remote software version OpenSSH_3.4p1 homer.somesite.com: Net::SSH::Perl Version 1.30, protocol version 2.0. homer.somesite.com: No compat match: OpenSSH_3.4p1. homer.somesite.com: Connection established. homer.somesite.com: Sent key-exchange init (KEXINIT), wait response. homer.somesite.com: Algorithms, c->s: 3des-cbc hmac-sha1 none homer.somesite.com: Algorithms, s->c: 3des-cbc hmac-sha1 none homer.somesite.com: Entering Diffie-Hellman Group 1 key exchange. homer.somesite.com: Sent DH public key, waiting for reply. homer.somesite.com: Received host key, type 'ssh-dss'. homer.somesite.com: Host 'localhost' is known and matches the host key. homer.somesite.com: Computing shared secret key. homer.somesite.com: Verifying server signature. homer.somesite.com: Waiting for NEWKEYS message. homer.somesite.com: Enabling incoming encryption/MAC/compression. homer.somesite.com: Send NEWKEYS, enable outgoing encryption/MAC/compression. homer.somesite.com: Sending request for user-authentication service. homer.somesite.com: Service accepted: ssh-userauth. homer.somesite.com: Trying empty user-authentication request. homer.somesite.com: Authentication methods that can continue: publickey,password,keyboard-interactive. homer.somesite.com: Next method to try is publickey. homer.somesite.com: Next method to try is password. homer.somesite.com: Trying password authentication. homer.somesite.com: Will not query passphrase in batch mode. homer.somesite.com: Authentication methods that can continue: publickey,password,keyboard-interactive. homer.somesite.com: Next method to try is publickey. homer.somesite.com: Next method to try is password. homer.somesite.com: Trying password authentication. homer.somesite.com: Will not query passphrase in batch mode. homer.somesite.com: Authentication methods that can continue: publickey,password,keyboard-interactive. homer.somesite.com: Next method to try is publickey. homer.somesite.com: Next method to try is password. homer.somesite.com: Trying password authentication. homer.somesite.com: Will not query passphrase in batch mode. homer.somesite.com: Authentication methods that can continue: publickey,password,keyboard-interactive. homer.somesite.com: Next method to try is publickey. homer.somesite.com: Next method to try is password. Permission denied at /usr/lib/perl5/site_perl/5.6.1/Net/SFTP.pm line 37 Debugged program terminated. Use q to quit or R to restart, use O inhibit_exit to avoid stopping after program termination, h q, h R or h O to get additional info. DB<1> I am on perl 5.6.1 and I have tried versions 0.10 and 0.08 of Net::SFTP with the same results. Any help would be greatly appreciated. Thanks, John |
From: Pitoniso R. R. <ais...@ya...> - 2007-04-09 21:25:48
|
that method uses this option to be connected to my server SSH... thx --------------------------------- LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com |
From: Alexander K. <ale...@gm...> - 2007-03-15 12:32:54
|
2007/3/15, David Robins <dbr...@cp...>: > On Wednesday March 14, 2007 02:35, Alexander Kolotov wrote: > > This question is not to users but to authors of Net:SSH:Perl module. > > > > Could anybody tell me why we duplicate STDIN in _session_channel of > > SSH2.pm please? > > I'm the current maintainer, but I don't know why we do that - it was there when I took over the code. > > Perhaps the better question is, what happens if we no longer do it? Will it break anything important? The _session_channel method is used by several methods of SSH2.pm module: cmd, shell, open2 in order to open client session channel. I can not say that will happen if we do not duplicate STDIN for these cases. It is really difficult to understand this module without any development documents and almost without comments. Maybe you can perform some tests without duplicated STDIN. I can say only that receiving of files through SFTP works fine in this case. -- Alexander Kolotov |
From: David R. <dbr...@cp...> - 2007-03-15 03:21:24
|
On Wednesday March 14, 2007 02:35, Alexander Kolotov wrote: > This question is not to users but to authors of Net:SSH:Perl module. > > Could anybody tell me why we duplicate STDIN in _session_channel of > SSH2.pm please? I'm the current maintainer, but I don't know why we do that - it was there when I took over the code. Perhaps the better question is, what happens if we no longer do it? Will it break anything important? > my $channel = $cmgr->new_channel( > ctype => 'session', local_window => 32*1024, > local_maxpacket => 16*1024, remote_name => 'client-session', > rfd => _dup('STDIN', '<'), wfd => _dup('STDOUT', '>'), > efd => _dup('STDERR', '>')); > > It causes issues like "SFTP::do_stat returns error if <ENTER> key is > pressed" (sent 2006-11-29) > > I can not find the answer by myself. So, I decided to ask here about > this. Maybe together we can find the fix of this annoying issue. -- Dave Isa. 40:31 |
From: Alexander K. <ale...@gm...> - 2007-03-14 10:35:14
|
Hi, This question is not to users but to authors of Net:SSH:Perl module. Could anybody tell me why we duplicate STDIN in _session_channel of SSH2.pm please? my $channel = $cmgr->new_channel( ctype => 'session', local_window => 32*1024, local_maxpacket => 16*1024, remote_name => 'client-session', rfd => _dup('STDIN', '<'), wfd => _dup('STDOUT', '>'), efd => _dup('STDERR', '>')); It causes issues like "SFTP::do_stat returns error if <ENTER> key is pressed" (sent 2006-11-29) I can not find the answer by myself. So, I decided to ask here about this. Maybe together we can find the fix of this annoying issue. Thanks, -- Alexander Kolotov |
From: David R. <dbr...@cp...> - 2007-02-24 17:02:20
|
I apologize for the delay, but in my defense, a tree fell through my bedroom and nearly killed me (not one of those wimpy east coast trees, a ginormous Pacific cedar). Fortunately injuries were minor and insurance is paying. Here are the changes for Net::SSH2 0.10, which you can get at http://search.cpan.org/dist/Net-SSH2 as soon as it's been indexed: 0.10 2007-02-24 dbr (svn revision 52) - Net::SSH2::SFTP::realpath fix (Hugues Lafarge). - Make compatible with perl 5.6 (rt.cpan.org #22821, SISYPHUS); required minimal changes to typemap and use <version> lines (untested). - libssh2 0.13 seems to work, libssh2 0.14 still fails some tests. - Add missing Net::SSH2::PublicKey object. - Use (arbitrary) 8K buffer in scp_get and scp_put methods, rather than trying to transfer the whole file at once (rt.cpan.org #20679). - Remove 'use Term::ReadKey'; it's already 'require'd in the keyboard authentication callback (rt.cpan.org #22786). - Provide libssh2 with Perl's allocator callbacks and use Perl_malloc/ Perl_mfree instead of bare malloc/free (rt.cpan.org #23930). Note that there are some test failures with libssh2 0.14 so I recommend using 0.13 or 0.12; I'm not going to worry too much about 0.14 with 0.15 nearly out; when 0.15 is released I'll make sure Net::SSH2 works with it. With these fixes there are no active bugs in rt.cpan.org for Net::SSH2. As always, detailed bug reports and especially patches are welcome. -- Dave Isa. 40:31 |
From: Kenneth B. <ke...@te...> - 2007-02-18 21:12:36
|
I was wondering if you can help me get the Net::SFTP module working. I am very new to the Linux world and I used the following command to install the module: perl -MCPAN -e 'install Net::SFTP' I went through the installtion which I thought was successful. When I execute the following I get a connection timeout: #!/usr/bin/perl # Use statements. use strict; use warnings; use Net::SFTP; # Connect to our SFTP stage server. my $sftp = Net::SFTP->new("XXX.XXX.XXX.XXX", user=>"XXXXXXXX", password=>"XXXXXXXXXX", debug=>1); I get the following output: aabox02: Reading configuration data /root/.ssh/config aabox02: Reading configuration data /etc/ssh_config aabox02: Allocated local port 1023. aabox02: Connecting to 208.109.219.89 , port 22. Can't connect to 208.109.219.89, port 22: Connection timed out at /usr/lib/perl5/site_perl/5.8.0/Net/SSH/Perl.pm line 208. I have also run the following to insure the SSH module is installed: perl -MCPAN -e 'install Net::SSH' My perl version is 5.8 running on Red Hat Linux: Linux version 2.4.21-32.ELsmp (bhc...@tw...) (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-52)) #1 SMP Fri Apr 15 21:17:59 EDT 2005 I have no problem accessingsftp if I use the command line sftp program. Any help you can provide would be great. Thanks, Ken |
From: Cole T. <col...@gm...> - 2007-02-12 16:15:09
|
Here's one more tidbit - I'm hoping somebody can offer help here because I'm ready to fall back on using an Expect script if I can't get this working... In any case, if I try to do a ->read, it sometimes fails. I added this debugging line: printf STDERR "There was a problem with the read: (%s) (%s) (%s)\n", $!, $ssh2->error, $sftp->error; This seems to yield a lot of: There was a problem with the read: (Resource temporarily unavailable) (-30) (LIBSSH2_ERROR_SOCKET_TIMEOUT) Can anybody offer any help/suggestions? -- Cole Tuininga http://www.tuininga.org/ |
From: Serge L. <ser...@gm...> - 2007-02-12 10:33:33
|
David Robins wrote: > On Saturday February 10, 2007 09:30, Serge Leschinsky wrote: >> I'm trying to see the result of executing "uname -a" on my host. >> Unfortunately, there is no output from the script. Could you please point >> me what I do wrong? > > Both your test1 and test2 scripts below works fine for me (using Gentoo > Linux, perl 5.8.8, Net::SSH2 0.09). Try adding a sleep(5) before you start > reading the output, to see if it's just an output delay. > Thank you for the replay. I've tried, but got the same result... But I did another test and, really, it can be clue. What I do: 1. execute script with _long_ command 2. measure time of executing for script - really the time depends on sleep(5); 3. check if the process exists. It looks like the $chan->exec() detach control terminal. It's very useful behavior but how can I manage it (I mean how to define detach or keep stdin, stdout etc)? May I ask you to help me in this? Probably I just missed something important in the manual for Net::SSH2. [root@lx-sles ~]# cat 123 #!/usr/bin/perl -w use strict; use Net::SSH2; my $ssh2 = Net::SSH2->new(); print "connect fail\n" unless ($ssh2->connect('127.0.0.1')); print "password fail\n" unless ($ssh2->auth_password('root', 'xxxx')); # test2 my $chan=$ssh2->channel(); $chan->exec('LIMIT=10 ; for ((a=1; a <= LIMIT ; a++)) ; do expr 2 \* $a ; sleep 10; done') or warn $!; sleep(5); while (<$chan>){ print $_ } ; $chan->close; exit 0 [root@lx-sles ~]# time ./123 real 0m5.245s user 0m0.104s sys 0m0.008s [root@lx-sles ~]# ps axf ....... 12273 ? Ss 0:00 bash -c LIMIT=10 ; for ((a=1; a <= LIMIT ; a++)) ; do expr 2 \* 12293 ? S 0:00 \_ sleep 10 -- Sincerely Serge Leschinsky |
From: David R. <dbr...@cp...> - 2007-02-12 01:52:18
|
On Saturday February 10, 2007 09:30, Serge Leschinsky wrote: > I'm trying to see the result of executing "uname -a" on my host. > Unfortunately, there is no output from the script. > Could you please point me what I do wrong? Both your test1 and test2 scripts below works fine for me (using Gentoo Linux, perl 5.8.8, Net::SSH2 0.09). Try adding a sleep(5) before you start reading the output, to see if it's just an output delay. -- Dave Isa. 40:31 |
From: Serge L. <ser...@gm...> - 2007-02-10 17:30:46
|
HI, I'm trying to see the result of executing "uname -a" on my host. Unfortunately, there is no output from the script. Could you please point me what I do wrong? I tried to do it with opensuse 10.2 and FC 5, perl v5.8.8, *libssh2-0.14 , Net-SSH2-0.09 * Note: Everything is ok If I do the following $chan->exec('uname -a > /tmp/my'); my $sftp = $ssh2->sftp() or die $!; my $fh = $sftp->open('/tmp/my') or die $!; print $_ while <$fh>; so the lib and module are working, but I guess it's a bad way. Script: --------------------------------------8<----------------------------------------- #!/usr/bin/perl -w use strict; use Net::SSH2; my $ssh2 = Net::SSH2->new(); print "connect fail\n" unless ($ssh2->connect('127.0.0.1')); print "password fail\n" unless ($ssh2->auth_password('root', 'xxx')); # test1 my $chan=$ssh2->channel(); $chan->shell(); print $chan "uname -a\n"; print "LINE : $_" while <$chan>; $chan->close; # test2 $chan=$ssh2->channel(); $chan->exec('uname -a'); while (<$chan>){ print $_ } ; $chan->close; exit 0 --------------------------------------8<----------------------------------------- -- Sincerely Serge Leschinsky |
From: Cole T. <col...@gm...> - 2007-02-09 20:00:51
|
And incidentally, whenever I get the "Resource temporarily unavailable", $sftp->error is "0" and $ssh2->error is "SSH_FX_OK". -- Cole Tuininga http://www.tuininga.org/ |
From: Cole T. <col...@gm...> - 2007-02-09 14:55:17
|
Hi all - I'm having an interesting issue with trying to read a file across an sftp connection. Namely, if I try to call ->read on a file that I open across the sftp connection, the connection no longer seems to be available for other traffic. I've attached a small sample script to demonstrate (the equivalent of) what I'm trying to do. The idea is that, after getting a file listing, I'm trying to read in each file that passes a certain regex. The problem is that after the first read in, all subsequent stats calls (or read calls, if I were trying them) fail with a "Resource temporarily unavailable" in $!. The interesting bit is that if I remove the read call on line 38, it gets rid of the problem (even if I leave the ->open call in). Anybody have any thoughts? -- Cole Tuininga http://www.tuininga.org/ |
From: Charles S B. <cb...@jc...> - 2007-02-09 13:36:51
|
David Robins wrote: > This appears to be a libssh2 issue and not specifically Net::SSH2; the > perl module is finding libssh2 but libssh2 can't find some of its symbols. > How did you build libssh2? Did you run its tests? Thank you for your response. I went ahead and re-built libssh2 to get some screen captures. - =3D - =3D - =3D - =3D - =3D - =3D - =3D - =3D - =3D - =3D - Openssl location: /usr/sfw/include/openssl - =3D - =3D - =3D - =3D - =3D - =3D - =3D - =3D - =3D - =3D - development[/netdist/apps/libssh2-0.14]# ./configure --with-openssl=3D/usr/sfw checking build system type... sparc-sun-solaris2.10 checking host system type... sparc-sun-solaris2.10 checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables...=20 checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for socket in -lsocket... yes checking for ceil in -lm... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ANSI C... (cached) none needed checking for a BSD-compatible install... ./install-sh -c checking whether ln -s works... yes checking whether make sets $(MAKE)... yes checking for ranlib... ranlib checking whether byte ordering is bigendian... yes checking for pkg-config... /usr/bin/pkg-config checking for OpenSSL... Using explicit path /usr/sfw checking for libz... Found in /usr/include /usr/lib checking how to run the C preprocessor... gcc -E checking for egrep... egrep checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking errno.h usability... yes checking errno.h presence... yes checking for errno.h... yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking stdio.h usability... yes checking stdio.h presence... yes checking for stdio.h... yes checking for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking sys/uio.h usability... yes checking sys/uio.h presence... yes checking for sys/uio.h... yes checking sys/select.h usability... yes checking sys/select.h presence... yes checking for sys/select.h... yes checking for poll... yes checking for gettimeofday... yes checking for select... yes checking for an ANSI C-conforming const... yes configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating include/libssh2_config.h config.status: include/libssh2_config.h is unchanged development[/netdist/apps/libssh2-0.14]#=20 - =3D - =3D - =3D - =3D - =3D - =3D - =3D - =3D - =3D - =3D - The docs state I should now "make all install". When I look in the makefile, I don't see a "test:" section. development[/netdist/apps/libssh2-0.14]# make all install make[1]: Entering directory `/tftpboot/netdist/apps/libssh2-0.14/src' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/tftpboot/netdist/apps/libssh2-0.14/src' ./mkinstalldirs /usr/local/include ./mkinstalldirs /usr/local/lib make[1]: Entering directory `/tftpboot/netdist/apps/libssh2-0.14/src' .././install-sh -c libssh2.so /usr/local/lib make[1]: Leaving directory `/tftpboot/netdist/apps/libssh2-0.14/src' ./install-sh -c -m 644 include/libssh2.h /usr/local/include/ ./install-sh -c -m 644 include/libssh2_sftp.h /usr/local/include/ ./install-sh -c -m 644 include/libssh2_publickey.h /usr/local/include/ development[/netdist/apps/libssh2-0.14]#=20 I attempt to install Net::SSH2 via cpan, same errors as in previous post. - =3D - =3D - =3D - =3D - =3D - =3D - =3D - =3D - =3D - =3D - Other Info: development[/usr/sfw/include/openssl]# find / -name libssh2.so /usr/local/lib/libssh2.so |
From: David R. <dbr...@cp...> - 2007-02-09 03:28:02
|
On Thursday February 8, 2007 12:49, Charles S Brown wrote: > Installing via cpan. Everything looks fine until it attempts to make > test. > - - - - - - > Running make test > PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" > "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t > t/Net-SSH2.... > t/Net-SSH2....NOK 1/72# Failed test 'use > Net::SSH2;' > # at t/Net-SSH2.t line 19. > # Tried to use 'Net::SSH2'. > # Error: Can't load '/.cpan/build/Net-SSH2-0.09/blib/arch/auto/ > Net/SSH2/SSH2.so' for module Net::SSH2: ld.so.1: perl: fatal: > relocation error: file /usr/local/lib/libssh2.so: symbol > EVP_aes_192_cbc: referenced symbol not found at /usr/local/lib/ > perl5/5.8.7/sun4-solaris/DynaLoader.pm line 230. > # at (eval 3) line 2 > - - - - - - > > Usually, I can decipher some clue as to why a module isn't installing > and go hunting for an answer. However, i can't seem to figure out > which way to go on this one. > > If you have any suggestions, they would be greatly appreciated. This appears to be a libssh2 issue and not specifically Net::SSH2; the perl module is finding libssh2 but libssh2 can't find some of its symbols. How did you build libssh2? Did you run its tests? -- Dave Isa. 40:31 |
From: Charles S B. <cb...@jc...> - 2007-02-08 20:50:54
|
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If the reader of this message is not the intended recipient, you are hereby notified that your access is unauthorized, and any review, dissemination, distribution or copying of this message including any attachments is strictly prohibited. If you are not the intended recipient, please contact the sender and delete the material from any computer. |
From: Chakresh Y. <cy...@ns...> - 2007-01-13 02:06:20
|
Hi Paulo, The command does not hang if executed directly on unix box but give back the prompt. "nohup" does not work either. I tried "service snmpd start &" and it works fine and perl script exits properly. So for unix server I can remotely execute the command now. Now, I am trying to run a similar script to run a batch file on remote windows machine and it hangs with a different message this time. ChakreshYadavPC: Reading configuration data /.ssh/config ChakreshYadavPC: Reading configuration data /etc/ssh_config ChakreshYadavPC: Connecting to 192.168.1.125, port 22. ChakreshYadavPC: Remote version string: SSH-2.0-VShell_2_3_4_234 VShell ChakreshYadavPC: Remote protocol version 2.0, remote software version VShell_2_3 _4_234 VShell ChakreshYadavPC: Net::SSH::Perl Version 1.30, protocol version 2.0. .hakreshYadavPC: No compat match: VShell_2_3_4_234 VShell ChakreshYadavPC: Connection established. ChakreshYadavPC: Sent key-exchange init (KEXINIT), wait response. ChakreshYadavPC: Algorithms, c->s: 3des-cbc hmac-sha1 none ChakreshYadavPC: Algorithms, s->c: 3des-cbc hmac-sha1 none ChakreshYadavPC: Entering Diffie-Hellman Group 1 key exchange. ChakreshYadavPC: Sent DH public key, waiting for reply. ChakreshYadavPC: Received host key, type 'ssh-dss'. ChakreshYadavPC: Host '192.168.1.125' is known and matches the host key. ChakreshYadavPC: Computing shared secret key. ChakreshYadavPC: Verifying server signature. ChakreshYadavPC: Waiting for NEWKEYS message. ChakreshYadavPC: Enabling incoming encryption/MAC/compression. ChakreshYadavPC: Send NEWKEYS, enable outgoing encryption/MAC/compression. ChakreshYadavPC: Sending request for user-authentication service. ChakreshYadavPC: Service accepted: ssh-userauth. ChakreshYadavPC: Trying empty user-authentication request. ChakreshYadavPC: Authentication methods that can continue: password,publickey. ChakreshYadavPC: Next method to try is password. ChakreshYadavPC: Trying password authentication. ChakreshYadavPC: Login completed, opening dummy shell channel. ChakreshYadavPC: channel 0: new [client-session] ChakreshYadavPC: Requesting channel_open for channel 0. ChakreshYadavPC: channel 0: open confirm rwindow 32768 rmax 16384 ChakreshYadavPC: Got channel open confirmation, requesting shell. ChakreshYadavPC: Requesting service shell on channel 0. ChakreshYadavPC: channel 1: new [client-session] ChakreshYadavPC: Requesting channel_open for channel 1. ChakreshYadavPC: Entering interactive session. uncopycleanavPC: Sending command: c: ChakreshYadavPC: Requesting service exec on channel 1. ChakreshYadavPC: channel 1: open confirm rwindow 32768 rmax 16384 Before opening a ssh connection, I am using a windows client (pscp.exe) to create directories and copy some files (it is done with success). Code snippet $CMD = "c:\\pscp.exe -l $userName -pw $password -r $sourceFileName $targetIP:$destinationDir"; system("$CMD"); #start a SSH shell for activation my $ssh = Net::SSH::Perl->new($targetIP, debug=>1); $ssh->login($userName,$password); my ($stdout, $stderr, $exit) = $ssh->cmd("c:\run\runcopyclean"); if ($exit != 0 ){ warn "An error has occured - exit code:$exit\nerror message:$stderr"; } else { print "ssh command succeeded - Good Bye"; $ssh->cmd("exit"); } print ("\nBye"); thanks Chakresh |
From: Sant'Anna, P. \(IT\) <Pau...@mo...> - 2007-01-12 19:12:38
|
Does this command hangs the terminal also if you execute directly on the Unix box? You can try the following to detach it from the terminal =20 $ssh->cmd("nohup service snmpd start"); =20 Thanks, =20 -- Paulo ________________________________ From: Chakresh Yadav [mailto:cy...@ns...]=20 Sent: Friday, January 12, 2007 1:36 PM To: Sant'Anna, Paulo (IT); ssh...@li... Subject: RE: [Ssh-sftp-perl-users] Problem using Net::SSH::Perl Thanks for prompt reply. I tried this piece of code but don't see pl script exiting on the windows box. The command is successfully executed on the remote Unix server. =20 I go to the unix box and stop the service and then perl script exits successfully. =20 Does this give any clue what's going on ??? =20 I tried giving the command "touch /tmp/abc.txt" and the file is created on unix server and perl scipt also exits. Why perl script behaves differently for these 2 different commands on remote box ? =20 Thanks Chakresh =20 =20 ________________________________ From: Sant'Anna, Paulo (IT) [mailto:Pau...@mo...]=20 Sent: Friday, January 12, 2007 7:21 AM To: cy...@ns...; ssh...@li... Subject: RE: [Ssh-sftp-perl-users] Problem using Net::SSH::Perl =20 I don't think the connection is dropped after a command is send. You might want to add: =20 $ssh->cmd("exit"); =20 to your script to close the connection. =20 Thanks, =20 -- Paulo =20 =20 ________________________________ From: ssh...@li... [mailto:ssh...@li...] On Behalf Of Chakresh Yadav Sent: Thursday, January 11, 2007 9:55 PM To: ssh...@li... Subject: [Ssh-sftp-perl-users] Problem using Net::SSH::Perl Hi, =20 I am running a simple script to execute a command on a remote linux server. The machine on which pl script is running is windows XP (no cygwin installed). Below is the script and output =20 #testing script use Net::SSH::Perl; =20 $targetIP =3D shift; $userName =3D shift; $password =3D shift; $sourceFileName =3D shift; $destinationDir =3D shift; =20 my $ssh =3D Net::SSH::Perl->new($targetIP, debug=3D>1); $ssh->login($userName,$password); =20 $ssh->cmd("service snmpd start"); =20 print "Bye"; =20 The debug output is=20 =20 ChakreshYadavPC: Reading configuration data /.ssh/config ChakreshYadavPC: Reading configuration data /etc/ssh_config ChakreshYadavPC: Connecting to 192.168.1.203, port 22. ChakreshYadavPC: Remote version string: SSH-1.99-OpenSSH_3.5p1 =20 ChakreshYadavPC: Remote protocol version 1.99, remote software version OpenSSH_3 .5p1 ChakreshYadavPC: Net::SSH::Perl Version 1.30, protocol version 1.5. ChakreshYadavPC: No compat match: OpenSSH_3.5p1. ChakreshYadavPC: Connection established. ChakreshYadavPC: Waiting for server public key. ChakreshYadavPC: Received server public key (768 bits) and host key (1024 bits). =20 ChakreshYadavPC: Host '192.168.1.203' is known and matches the host key. ChakreshYadavPC: Encryption type: DES3 ChakreshYadavPC: Sent encrypted session key. ChakreshYadavPC: Received encryption confirmation. ChakreshYadavPC: RSA authentication failed: Can't load public key. ChakreshYadavPC: Doing challenge response authentication. ChakreshYadavPC: No challenge presented. ChakreshYadavPC: Trying password authentication. ChakreshYadavPC: Sending command: service snmpd start ChakreshYadavPC: Entering interactive session. =20 =20 The scipt does not exit after sending command to remote box. I can see service "snmpd" running on remote Unix server but no message "Bye" on windows box. =20 Does anyone has faced this issue ? Any pointers will be highly appreciated as I need this script to run ASAP. =20 Thanks Chakresh =20 =20 =20 =20 =20 ________________________________ NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error. -------------------------------------------------------- NOTICE: If received in error, please destroy and notify sender. Sender = does not intend to waive confidentiality or privilege. Use of this email = is prohibited when received in error. |