Re: [Ssh-sftp-perl-users] Net::SSH::Perl - Problem with cmd()
Brought to you by:
dbrobins
From: Dave R. <au...@ur...> - 2003-12-03 15:53:58
|
Can you do me a favor and report this via rt.cpan.org at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=net%3A%3Assh%3A%3Aperl ? More than one person will be working on maintenance for this module, so having real bug tracking is important. Thanks, -dave On Mon, 1 Dec 2003, Roland Gruber wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi all, > > I have problems executing multiple commands with the cmd() function. > Only the first command is executed correctly. The others are ignored and > the return values of cmd() are all empty. > > Here is an example code: > > my $ssh = Net::SSH::Perl->new($hostname, > options=>["UserKnownHostsFile /dev/null"], > protocol => "2,1", > debug => true ); > $ssh->login($username, $password); > for ($i=0; $i<=30; $i++) { > ($stdout, $stderr, $exit) = $ssh->cmd("touch /tmp/test$i"); > } > > > The debug output: > > Roland: Reading configuration data /home/roland/.ssh/config > Roland: Reading configuration data /etc/ssh_config > Roland: Connecting to localhost, port 22. > Roland: Remote protocol version 2.0, remote software version > OpenSSH_3.6.1p2 Debian 1:3.6.1p2-9 > Roland: Net::SSH::Perl Version 1.24, protocol version 2.0. > Roland: No compat match: OpenSSH_3.6.1p2 Debian 1:3.6.1p2-9. > Roland: Connection established. > Roland: Sent key-exchange init (KEXINIT), wait response. > Roland: Algorithms, c->s: 3des-cbc hmac-sha1 none > Roland: Algorithms, s->c: 3des-cbc hmac-sha1 none > Roland: Entering Diffie-Hellman Group 1 key exchange. > Roland: Sent DH public key, waiting for reply. > Roland: Received host key, type 'ssh-dss'. > Roland: Permanently added 'localhost' to the list of known hosts. > Roland: Computing shared secret key. > Roland: Verifying server signature. > Roland: Waiting for NEWKEYS message. > Roland: Enabling incoming encryption/MAC/compression. > Roland: Send NEWKEYS, enable outgoing encryption/MAC/compression. > Roland: Sending request for user-authentication service. > Roland: Service accepted: ssh-userauth. > Roland: Trying empty user-authentication request. > Roland: Authentication methods that can continue: > publickey,password,keyboard-interactive. > Roland: Next method to try is publickey. > Roland: Publickey: testing agent key '/home/roland/.ssh/id_dsa' > Roland: Authentication methods that can continue: > publickey,password,keyboard-interactive. > Roland: Next method to try is publickey. > Roland: Trying pubkey authentication with key file > '/home/roland/.ssh/id_dsa' > Roland: Will not query passphrase for '/home/roland/.ssh/id_dsa' in > batch mode. > Roland: Loading private key failed. > Roland: Next method to try is password. > Roland: Trying password authentication. > Roland: Login completed, opening dummy shell channel. > Roland: channel 0: new [client-session] > Roland: Requesting channel_open for channel 0. > Roland: channel 0: open confirm rwindow 0 rmax 32768 > Roland: Got channel open confirmation, requesting shell. > Roland: Requesting service shell on channel 0. > Roland: channel 1: new [client-session] > Roland: Requesting channel_open for channel 1. > Roland: Entering interactive session. > Roland: Sending command: touch /tmp/o1/test0 > Roland: Requesting service exec on channel 1. > Roland: channel 1: open confirm rwindow 0 rmax 32768 > Roland: input_channel_request: rtype exit-status reply 0 > Roland: channel 1: rcvd eof > Roland: channel 1: output open -> drain > Roland: channel 1: rcvd close > Roland: channel 1: input open -> closed > Roland: channel 1: close_read > Roland: channel 1: obuf empty > Roland: channel 1: output drain -> closed > Roland: channel 1: close_write > Roland: channel 1: send close > Roland: channel 1: full closed > Roland: channel 2: new [client-session] > Roland: Requesting channel_open for channel 2. > Roland: Entering interactive session. > Roland: channel 3: new [client-session] > Roland: Requesting channel_open for channel 3. > > > My Perl version is 5.8.0, Net::SSH::Perl is 1.24 running on Debian Sarge. > > > Thanks, > Roland > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.3 (GNU/Linux) > Comment: Using GnuPG with Debian - http://enigmail.mozdev.org > > iD8DBQE/y0tBq/ywNCsrGZ4RAsEpAJ4unbBr7MvfwIz6Bfh2pX2wa6w8EQCfd9qV > XvZqw2BQ1dYE9Zmtsp0cl1A= > =/u87 > -----END PGP SIGNATURE----- > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users > /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |