ssh-sftp-perl-users Mailing List for Net::SSH and Net::SFTP - Perl modules (Page 19)
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: David R. <dbr...@cp...> - 2006-09-30 03:16:19
|
On Wednesday September 27, 2006 16:18, U235Sentinel wrote:
> In NET::SSH::PERL we had a "register handler" method we could call which
> I've used to trigger a subroutine when we receive STDERR traffic. Is there
> some way to do this with NET::SSH2?
>
> The NET::SSH::PERL module had the following defined for the method:
>
> sub register_handler { }
>
> I'm presuming the code is found elsewhere (maybe this is a regular Perl
> method?)
>
> Any help/tips on where I could follow up on this is greatly appreciated.
> Thanks!
Not in the same way, but if you look at the poll method you can get stderr events, and Net::SSH2::Channel lets you read stderr separately (see perldoc).
--
Dave
Isa. 40:31
|
|
From: U235Sentinel <u23...@gm...> - 2006-09-29 15:00:20
|
In NET::SSH::PERL we had a "register handler" method we could call which
I've used to trigger a subroutine when we receive STDERR traffic. Is there
some way to do this with NET::SSH2?
The NET::SSH::PERL module had the following defined for the method:
sub register_handler { }
I'm presuming the code is found elsewhere (maybe this is a regular Perl
method?)
Any help/tips on where I could follow up on this is greatly appreciated.
Thanks!
|
|
From: Art A. <aix...@ya...> - 2006-09-14 17:03:13
|
I use ssh to go to logical hosts on a clustered system (VCS). When the logical host is moved from one system to the other, I get an error that the host key is incorrect. Has anyone run into this? Is there a work around? I typically tell the users to delete the entry from the .ssh/known_hosts and say yes to add the host before running thier scritps again. I would much rather have an automated way to manage this. Thanks Art --------------------------------- Do you Yahoo!? Everyone is raving about the all-new Yahoo! Mail. |
|
From: Miguel A. <mig...@gm...> - 2006-09-13 09:28:49
|
Hi All, First thanks for reading this ! I'm currently trying to implement sftp support on by perl backup program, simplebackup ( http://migas.kicks-ass.org/index.php?pag=en.myapps&subpag=simplebackup ) But i'm getting stuck, the program manages to connect but it never (aparently) to login, no mather what code i try to use, plus i'm unable to control the login process... the program just dies i can't get it control with eval or any other thing. Here is a example: eval { require Net::SFTP; #attempt to detect if the sftp modulo is installed }; if ($@) { print "Error Net::SFTP module is not installed\n"; } my %ssh_args = ( port => "443", debug => "1", ); my %sftp_args = ( user => "some_user", password => "some_password", debug => "1", ssh_args=>\%ssh_args, ); eval { $ftp_sftp_connection_p = Net::SFTP->new( "some_server", %sftp_args); } if ($@) { # THIS CODE NEVER WORKS... the script DIES print "Failed loginn"; } # # Here is the debug # migas: Reading configuration data /root/.ssh/config migas: Reading configuration data /etc/ssh_config migas: Allocated local port 1023. migas: Connecting to localhost, port 443. migas: Remote version string: SSH-1.99-OpenSSH_3.9p1 migas: Remote protocol version 1.99, remote software version OpenSSH_3.9p1 migas: Net::SSH::Perl Version 1.30, protocol version 2.0. migas: No compat match: OpenSSH_3.9p1. migas: Connection established. migas: Sent key-exchange init (KEXINIT), wait response. migas: Algorithms, c->s: 3des-cbc hmac-sha1 none migas: Algorithms, s->c: 3des-cbc hmac-sha1 none migas: Entering Diffie-Hellman Group 1 key exchange. migas: Sent DH public key, waiting for reply. migas: Received host key, type 'ssh-dss'. migas: Host 'localhost' is known and matches the host key. migas: Computing shared secret key. migas: Verifying server signature. migas: Waiting for NEWKEYS message. migas: Enabling incoming encryption/MAC/compression. migas: Send NEWKEYS, enable outgoing encryption/MAC/compression. migas: Sending request for user-authentication service. migas:~ # # There we return to the prompt... the script died # Here is the syslog message from the ssh server Sep 13 10:39:48 migas sshd[29484]: fatal: Timeout before authentication for::ffff:127.0.0.1 I also notice that the comunication process with the ssh server is very slow (minutes), can this be the problem ?? Can anyone give me any help... PLEASE , i have looked and look the net and several foruns to no avail. Stay Happy ! Miguel Angelo - Migas http://migas.kicks-ass.org ICQ: 40421832 Msn: mig...@gm... Google Talk: mig...@gm... |
|
From: Beginner <de...@sc...> - 2006-08-25 16:58:22
|
Hi,
I am trying to use Net::SFTP but am unable to make an connection. My
script appears to hang until I get the error:
...port 22: Connection timed out at
/usr/lib/perl5/site_perl/5.8.6/Net/SSH/Perl.pm l208
The error appears to come from Net::SSH::Perl so I imagine there is
something wrong with my config.
I can make the connection using the command-line sftp.
I have tried a number of additional parameters with Net::SSH::Perl
but I am not able to get a connection:
All of the other potential modules I could use for this task have the
same problem, so I expect the problem is with my underlying SSH::Perl
module.
Can anyone offer any tips/hints/advice? I am a bit stuck.
TIA.
Dp.
=========
use strict;
use warnings;
use web_config qw($ftp_server $ftp_user $ftp_passwd);
use Net::SSH::Perl;
#use Net::SFTP;
#use Net::SCP;
my $ssh = Net::SSH::Perl->new($ftp_server,
debug=>1,protocol=>'2,1',cipher=>'IDEA');
print "$ssh->config\n";
$ssh->login($ftp_user,$ftp_passwd) or die "Can't: $@ $!\n";
#my $ftp = Net::SFTP->new($ftp_server, debug=>1, user=>$ftp_user,
password=>$ftp_passwd,ssh_args=>[cipher=>'DES3'])
# or die "Can't connect to $ftp_server: $@";
#$ftp->quit;
#my $scp = Net::SCP->new($ftp_server,$ftp_user);
#$scp->put('sftp-test.pl', 'testfile') or die "Can't scp file: $@ $!
$?\n";
|
|
From: Iain B. <ia...@ne...> - 2006-08-23 01:57:22
|
On Thu, 2006-08-10 at 14:18 +0930, Iain Buchanan wrote: > Hi, > > I'm still having trouble using Net::SSH and Net::SFTP. The behaviour is > similar for both. Here's how I'm using SFTP: > > $sftpref = Net::SFTP->new($hostname, user=>$user, password=>$pass, debug=>TRUE, ssh_args => [ port => '22' ] ); > > And the debug output is listed below. At various places the program > just sits for 10-20 seconds using 100% CPU. well, aren't I the fool?!! It turns out I had Math::GMP installed but not Math::BigInt::GMP. After I installed Math::BigInt::GMP, my speed problems are gone. thanks. -- Iain Buchanan <iaindb at netspace dot net dot au> I like work; it fascinates me; I can sit and look at it for hours. |
|
From: Troy B. <tro...@un...> - 2006-08-17 19:31:47
|
I have a perl SFTP script that everything seems to work except for when
I try to set permissions on a remote file.. Here is my sample code:
...
$a = Net::SFTP::Attributes->new;
$a->perm(755);
foreach $item (@filelist) {
$dest = "/tmp/$item";
$confirm = $ftp->put($item,$dest);
$ftp->do_setstat($dest, $a);
print "Confirm: put $locl to $dest\n";
the file gets put over but the permissions are not changed. Any help
would be greatly appreciated..
thanks
troy
|
|
From: Sam Y. <Sam...@aa...> - 2006-08-11 00:30:03
|
Thanks Eric, it fixed the problem. IO::Handle is part of the standard Perl. I haven't seen Math::BigInt::GMP as part of the required modules for Net::SSH::Perl during the installation, I guess we maybe need to put this one into the required list. Thank you again, u saved me.=20 Kind Regards, Sam YANG System Analyst | Network Systems and Data Business & Technology Solutions AAPT Limited Ground Floor, 30 Ross Street, Glebe NSW 2037 Australia Tel: +61 2 9009 1103 Mob: +61 414 248 333 =46ax: +61 2 8284 9883 -----Original Message----- =46rom: Eric Langheinrich [mailto:net...@er...]=20 Sent: Friday, 11 August 2006 10:08 a.m. To: Sam Yang; ssh...@li... Subject: RE: [Ssh-sftp-perl-users] help Sam, =20 =20 >During the testing against two remote Unix machines, I have problem with one of them as indicated on Item 2 (Server named glbncs5). The problem related to it stopped on >the line "glbdev1: Algorithms, s->c: 3des-cbc hmac-sha1 none" for at least 5 minutes and slowly again to progress =66urther. So I am wondering why=3F And I could not figure >it out on top of my mind. So if you have any information on this, would be very much appreciated.=20 Generally, this occurs if you are missing a couple of modules. Try installing IO::Handle and Math::BigInt::GMP.=20 This usually fixes the problem. =09 =09 =09 This communication, including any attachments, is confidential. If you are = not the intended recipient, you should not read it - please contact me = immediately, destroy it, and do not copy or use any part of this = communication or disclose anything about it. |
|
From: Eric L. <net...@er...> - 2006-08-11 00:07:34
|
Sam, >During the testing against two remote Unix machines, I have problem with one of them as indicated on Item 2 (Server named glbncs5). The problem related to it stopped on >the line "glbdev1: Algorithms, s->c: 3des-cbc hmac-sha1 none" for at least 5 minutes and slowly again to progress further. So I am wondering why? And I could not figure >it out on top of my mind. So if you have any information on this, would be very much appreciated. Generally, this occurs if you are missing a couple of modules. Try installing IO::Handle and Math::BigInt::GMP. This usually fixes the problem. |
|
From: Sam Y. <Sam...@aa...> - 2006-08-10 23:53:18
|
Hi There,
I've recently downloaded and installed the Net::SSH::Perl module on one
of our Unix platform: SunOS glbdev1 5.6 Generic_105181-28 sun4u sparc
SUNW,Ultra-5_10
I've chosen the full feature and options during the installation so that
it handles SSH1 and SSH2.
I've also written up a quick test program:
#--------------------------------------------
my $ssh=3DNet::SSH::Perl->new($host,
'protocol','1,2','use_pty',1,'debug',1,'interactive',0);
if(!$ssh){
die "not ssh obj";
}
my $s1=3D$ssh->login($user,$pass);
my ($out,$error,$rcode) =3D $ssh->cmd($cmd);
print "s1=3D$s1; out=3D$out; error=3D$error; rcode=3D$rcode\n";
#--------------------------------------------
During the testing against two remote Unix machines, I have problem with
one of them as indicated on Item 2 (Server named glbncs5). The problem
related to it stopped on the line "glbdev1: Algorithms, s->c: 3des-cbc
hmac-sha1 none" for at least 5 minutes and slowly again to progress
=66urther. So I am wondering why=3F And I could not figure it out on top of
my mind. So if you have any information on this, would be very much
appreciated.
1. Against Remote Server: glbncs4
------------------------------------------------------------------------
------------------
syang@glbdev1[121] perl58 stest.pl=20
glbdev1: Reading configuration data /home/syang/.ssh/config
glbdev1: Reading configuration data /etc/ssh_config
glbdev1: Connecting to glbncs4, port 22.
glbdev1: Remote version string: SSH-1.99-OpenSSH_2.3.0p1
glbdev1: Remote protocol version 1.99, remote software version
OpenSSH_2.3.0p1
glbdev1: Net::SSH::Perl Version 1.30, protocol version 1.5.
glbdev1: No compat match: OpenSSH_2.3.0p1.
glbdev1: Connection established.
glbdev1: Waiting for server public key.
glbdev1: Received server public key (1152 bits) and host key (1024
bits).
glbdev1: Host 'glbncs4' is known and matches the host key.
glbdev1: Encryption type: DES3
glbdev1: Sent encrypted session key.
glbdev1: Received encryption confirmation.
glbdev1: Trying RSA authentication with key 'syang@glbdev1'
glbdev1: Server refused our key.
glbdev1: Server refused our key.
glbdev1: Trying password authentication.
glbdev1: Requesting pty.
glbdev1: Sending command: ls -l OneOffice
glbdev1: Entering interactive session.
s1=3Dxxx; out=3Dtotal 42
drwxrwsr-x 3 syang users 512 Aug 10 04:12 bin
drwxrwsr-x 2 syang users 512 Aug 10 03:27 config
drwxrwsr-x 2 syang users 512 Feb 8 2006 lock
drwxrwsr-x 2 syang users 512 Feb 8 2006 log
-rw-rw-r-- 1 syang sybase 8704 Jan 19 2006 oneoffice.cgi.tar
-rw-rw-r-- 1 syang sybase 6144 Jan 19 2006
oneoffice.htdocs.tar
drwxrwsr-x 2 syang users 512 Feb 8 2006 output
drwxrwsr-x 2 syang users 512 Jan 13 2006 sql
; error=3D; rcode=3D0
------------------------------------------------------------------------
----------------
Above test works perfect, and fast.
2. Against Remote Server: glbncs5
------------------------------------------------------------------------
----------------
syang@glbdev1[123] perl58 stest.pl=20
glbdev1: Reading configuration data /home/syang/.ssh/config
glbdev1: Reading configuration data /etc/ssh_config
glbdev1: Connecting to glbncs5, port 22.
glbdev1: Remote version string: SSH-2.0-OpenSSH_3.1p1
glbdev1: Remote protocol version 2.0, remote software version
OpenSSH_3.1p1
glbdev1: Net::SSH::Perl Version 1.30, protocol version 2.0.
glbdev1: No compat match: OpenSSH_3.1p1.
glbdev1: Connection established.
glbdev1: Sent key-exchange init (KEXINIT), wait response.
glbdev1: Algorithms, c->s: 3des-cbc hmac-sha1 none
glbdev1: Algorithms, s->c: 3des-cbc hmac-sha1 none
<<<<<<<=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3Dstucked here for 5 minutes
glbdev1: Entering Diffie-Hellman Group 1 key exchange.
glbdev1: Sent DH public key, waiting for reply.
glbdev1: Received host key, type 'ssh-dss'.
glbdev1: Host 'glbncs5' is known and matches the host key.
glbdev1: Computing shared secret key.
glbdev1: Verifying server signature.
glbdev1: Waiting for NEWKEYS message.
glbdev1: Enabling incoming encryption/MAC/compression.
glbdev1: Send NEWKEYS, enable outgoing encryption/MAC/compression.
glbdev1: Sending request for user-authentication service.
glbdev1: Service accepted: ssh-userauth.
glbdev1: Trying empty user-authentication request.
glbdev1: Authentication methods that can continue:
publickey,password,keyboard-interactive.
glbdev1: Next method to try is publickey.
glbdev1: Trying pubkey authentication with key file
'/home/syang/.ssh/id_dsa'
glbdev1: Authentication methods that can continue:
publickey,password,keyboard-interactive.
glbdev1: Next method to try is publickey.
glbdev1: Next method to try is password.
glbdev1: Trying password authentication.
glbdev1: Login completed, opening dummy shell channel.
glbdev1: channel 0: new [client-session]
glbdev1: Requesting channel_open for channel 0.
glbdev1: channel 0: open confirm rwindow 0 rmax 32768
glbdev1: Got channel open confirmation, requesting shell.
glbdev1: Requesting service shell on channel 0.
glbdev1: channel 1: new [client-session]
glbdev1: Requesting channel_open for channel 1.
glbdev1: Entering interactive session.
glbdev1: Sending command: ls -l OneOffice
glbdev1: Requesting service exec on channel 1.
glbdev1: channel 1: open confirm rwindow 0 rmax 32768
glbdev1: channel 1: rcvd eof
glbdev1: channel 1: output open -> drain
glbdev1: input_channel_request: rtype exit-status reply 0
glbdev1: channel 1: rcvd close
glbdev1: channel 1: input open -> closed
glbdev1: channel 1: close_read
glbdev1: channel 1: obuf empty
glbdev1: channel 1: output drain -> closed
glbdev1: channel 1: close_write
glbdev1: channel 1: send close
glbdev1: channel 1: full closed
s1=3D44; out=3Dtotal 42
drwxrwsr-x 3 syang users 512 Aug 10 04:12 bin
drwxrwsr-x 2 syang users 512 Aug 10 03:27 config
drwxrwsr-x 2 syang users 512 Feb 8 2006 lock
drwxrwsr-x 2 syang users 512 Feb 8 2006 log
-rw-rw-r-- 1 syang sybase 8704 Jan 19 2006 oneoffice.cgi.tar
-rw-rw-r-- 1 syang sybase 6144 Jan 19 2006
oneoffice.htdocs.tar
drwxrwsr-x 2 syang users 512 Feb 8 2006 output
drwxrwsr-x 2 syang users 512 Jan 13 2006 sql
; error=3DMust be attached to terminal for 'am I' option
; rcode=3D0
------------------------------------------------------------------------
--------------------------
This time is very very slow. 15 minutes in total.
Kind Regards,
Sam YANG
System Analyst | Network Systems and Data
Business & Technology Solutions
AAPT Limited
Ground Floor, 30 Ross Street,
Glebe NSW 2037
Australia
Tel: +61 2 9009 1103
Mob: +61 414 248 333
=46ax: +61 2 8284 9883
This communication, including any attachments, is confidential. If you are =
not the intended recipient, you should not read it - please contact me =
immediately, destroy it, and do not copy or use any part of this =
communication or disclose anything about it.
|
|
From: Nick E. <Nic...@pg...> - 2006-08-10 16:11:53
|
Hi David,
I had the exact same issue.
Not knowing Perl very well, I looked up error handling on google and
found that if I wrap BOTH the "new" mehod and the "login" function in an
"eval {}" block, the script will just stuff the errors into the @_
variable..
eval { $ssh = Net::SSH::Perl->new("$hostname"); };
if($@) {
print "Got an error, skipping this host";
<add what you want to do>
}
eval { $ssh->login("me","pass"); };
if($@) {
print "Got an error, skipping this host";
<add what you want to do>
}
Hope this helps :)
Nick
Nick Ellson
Infrastructure Specialist
PGE, Network Operations Center
Personal: (503) 464-2995
Network Trouble: (503) 464-8754
"Educating Layer 8, one user at a time."
>>> "Mark Funk" <mf...@tr...> 08/10/2006 7:28:47 AM >>>
Hello Folks,
I have over 800 Cisco Routers that I need to ssh into.
I do a socket connection test to skip any routers that are not
listening on
port 22,
But if the logon authentication fails, then my perl script exits.
I would like to log it and move on..
Does anybody have some code samples that logs failures and continues
without
exiting the perl script?
Thanks in Advance,
(Thanks Eric, I think this is working now!!)
David M. Funk
President/CEO
Tivoli Certified Enterprise Consultant
Specializing in Network and Systems Management Solutions
Trinity Solutions
604 Cassandra Dr.
Cranberry Twp., PA 16066
Phone: 724-316-0721
Fax: 724-772-7889
email: mf...@tr...
http://www.trinitysol.net
|
|
From: Iain B. <ia...@ne...> - 2006-08-10 04:49:00
|
Hi, I'm still having trouble using Net::SSH and Net::SFTP. The behaviour is similar for both. Here's how I'm using SFTP: $sftpref = Net::SFTP->new($hostname, user=>$user, password=>$pass, debug=>TRUE, ssh_args => [ port => '22' ] ); And the debug output is listed below. At various places the program just sits for 10-20 seconds using 100% CPU. I have Math::BigInt and IO::Handle installed. Logging in by hand works fine. The password contains a-z characters only. Can anyone shed some light? I'm worrried about "No compat match: OpenSSH_3.9p1." and "Trying empty user-authentication request." Any help would be greatly appreciated!! Thanks! === output === orpheus: Reading configuration data /home/iain/.ssh/config orpheus: Reading configuration data /etc/ssh_config orpheus: Connecting to 10.1.0.10, port 22. orpheus: Remote version string: SSH-2.0-OpenSSH_3.9p1 orpheus: Remote protocol version 2.0, remote software version OpenSSH_3.9p1 orpheus: Net::SSH::Perl Version 1.30, protocol version 2.0. orpheus: No compat match: OpenSSH_3.9p1. orpheus: Connection established. orpheus: Sent key-exchange init (KEXINIT), wait response. orpheus: Algorithms, c->s: 3des-cbc hmac-sha1 none orpheus: Algorithms, s->c: 3des-cbc hmac-sha1 none orpheus: Entering Diffie-Hellman Group 1 key exchange. orpheus: Sent DH public key, waiting for reply. orpheus: Received host key, type 'ssh-dss'. orpheus: Host '10.1.0.10' is known and matches the host key. orpheus: Computing shared secret key. orpheus: Verifying server signature. orpheus: Waiting for NEWKEYS message. orpheus: Enabling incoming encryption/MAC/compression. orpheus: Send NEWKEYS, enable outgoing encryption/MAC/compression. orpheus: Sending request for user-authentication service. orpheus: Service accepted: ssh-userauth. orpheus: Trying empty user-authentication request. orpheus: Authentication methods that can continue: publickey,keyboard-interactive. orpheus: Next method to try is publickey. Sftp connection failed: Permission denied at /usr/lib/perl5/vendor_perl/5.8.8/Net/SFTP.pm line 62 orpheus: Reading configuration data /home/iain/.ssh/config orpheus: Reading configuration data /etc/ssh_config orpheus: Connecting to 10.1.0.10, port 22. orpheus: Remote version string: SSH-2.0-OpenSSH_3.9p1 orpheus: Remote protocol version 2.0, remote software version OpenSSH_3.9p1 orpheus: Net::SSH::Perl Version 1.30, protocol version 2.0. orpheus: No compat match: OpenSSH_3.9p1. orpheus: Connection established. orpheus: Sent key-exchange init (KEXINIT), wait response. orpheus: Algorithms, c->s: 3des-cbc hmac-sha1 none orpheus: Algorithms, s->c: 3des-cbc hmac-sha1 none orpheus: Entering Diffie-Hellman Group 1 key exchange. orpheus: Sent DH public key, waiting for reply. orpheus: Received host key, type 'ssh-dss'. orpheus: Host '10.1.0.10' is known and matches the host key. orpheus: Computing shared secret key. orpheus: Verifying server signature. orpheus: Waiting for NEWKEYS message. orpheus: Enabling incoming encryption/MAC/compression. orpheus: Send NEWKEYS, enable outgoing encryption/MAC/compression. orpheus: Sending request for user-authentication service. orpheus: Service accepted: ssh-userauth. orpheus: Trying empty user-authentication request. orpheus: Authentication methods that can continue: publickey,keyboard-interactive. orpheus: Next method to try is publickey. Sftp connection failed: Permission denied at /usr/lib/perl5/vendor_perl/5.8.8/Net/SFTP.pm line 62 -- Iain Buchanan <iaindb at netspace dot net dot au> When angry, count four; when very angry, swear. -- Mark Twain, "Pudd'nhead Wilson's Calendar" |
|
From: Nick E. <Nic...@pg...> - 2006-08-09 15:03:02
|
<sigh> I found that wrapping the "new" method with an "eval {}" does
the trick, also wrapping the login in a second eval catches other
possible errors. This works for my purpose of simply dropping to telnet
for that host.
I learned me something new. :)
Nick
PS: My code sample
sub get_config_ssh{
$hostname = @_[0];
print "Connecting SSH to: $hostname... ";
use Net::SSH::Perl;
eval {
$ssh = Net::SSH::Perl->new("$hostname");
};
if($@) {
print "\n\n\nHOLD THE PHONE, SSHD not available!!\n\n\n";
}
$ssh->login("me",pass");
($out, $err, $exit) = $ssh->cmd("show ver");
print "out:\n $out\n\nerr:\n$err\n\nexit:\n\$exit\n\n";
}
Nick Ellson
Infrastructure Specialist
PGE, Network Operations Center
Personal: (503) 464-2995
Network Trouble: (503) 464-8754
"Educating Layer 8, one user at a time."
>>> "Nick Ellson" <Nic...@pg...> 08/09/2006 7:28 AM >>>
I have a net--telnet script that collects data from Cisco devices, and
it's pretty basic. I am adding ssh v1 &v2 support so I can collect
data
from devices that force Cisco's SSH version on that device. So far, as
long as the device answers to ssh, it was a pretty easy task. But if
the
system has no ssh ability, and I hit it with the script, it dies and
kills my script.
I have not done much error handling with scripts, so I was hoping I
could get some ideas on how to allow my script to recover from this
connection failure and let me drop to a telnet attempt.
I suppose I could do a test before calling the ssh module, see if
tcp/22 is answering, but net::telnet does a nice job of providing an
error of it cannot connect, does net::ssh::perl do that?
Nick
Nick Ellson
Infrastructure Specialist
PGE, Network Operations Center
Personal: (503) 464-2995
Network Trouble: (503) 464-8754
"Educating Layer 8, one user at a time."
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Ssh-sftp-perl-users mailing list
Ssh...@li...
https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users
|
|
From: Nick E. <Nic...@pg...> - 2006-08-09 14:28:43
|
I have a net--telnet script that collects data from Cisco devices, and it's pretty basic. I am adding ssh v1 &v2 support so I can collect data from devices that force Cisco's SSH version on that device. So far, as long as the device answers to ssh, it was a pretty easy task. But if the system has no ssh ability, and I hit it with the script, it dies and kills my script. I have not done much error handling with scripts, so I was hoping I could get some ideas on how to allow my script to recover from this connection failure and let me drop to a telnet attempt. I suppose I could do a test before calling the ssh module, see if tcp/22 is answering, but net::telnet does a nice job of providing an error of it cannot connect, does net::ssh::perl do that? Nick Nick Ellson Infrastructure Specialist PGE, Network Operations Center Personal: (503) 464-2995 Network Trouble: (503) 464-8754 "Educating Layer 8, one user at a time." |
|
From: David R. <dbr...@cp...> - 2006-08-02 03:09:28
|
On Tuesday August 1, 2006 10:15, Vee...@in... wrote:
> hi iam using NET::SSH::W32Perl
>
> in each $ssh->cmd; call channel closing ,
>
> if iahve senario like
> $ssh->cmd("cd /home/john");
> $ssh->cmd("ls -lrt ");
>
> but it is not listing the files in John directory ..bcoz each cmd call
> channel closing....
>
> is there any way to hold the channel for doing lot of commands
No, but you can with Net::SSH2.
> please give suggestion on this
--
Dave
Isa. 40:31
|
|
From: <Vee...@in...> - 2006-08-01 15:13:59
|
hi iam using NET::SSH::W32Perl
in each $ssh->cmd; call channel closing ,
if iahve senario like
$ssh->cmd("cd /home/john");
$ssh->cmd("ls -lrt ");
but it is not listing the files in John directory ..bcoz each cmd call
channel closing....
is there any way to hold the channel for doing lot of commands
please give suggestion on this
This email is confidential. If you are not the addressee tell the sender immediately and destroy this email
without using, sending or storing it. Emails are not secure and may suffer errors, viruses, delay,
interception and amendment. Standard Chartered PLC and subsidiaries ("SCGroup") do not accept liability for
damage caused by this email and may monitor email traffic.
|
|
From: Matthew J. S. <vag...@ya...> - 2006-08-01 13:48:14
|
I had a similar problem awhile back. I ended up using pieces from the module in the main script. The client loop and the shell subs were most important. I put the end result of the script on sourceforge, if you go throught the source, you should find what you need. http://sourceforge.net/projects/scriptable-ssh Good luck --- Markus <ma...@ni...> wrote: > I try to manage VPN gateway by using SSH, which > using a readhat kernel. > During the login process is possible to run in to a > dialog which needs to be > answered. > > The dialog looks like this: > > > > WARNING: There exist other CLI sessions. > > > > Current sessions (including this session): > > Logged on From > > Wed Jul 26 11:41 192.168.1.36 > > Wed Jul 26 11:41 192.168.1.37 > > > > Kill other sessions (yes/no) [no]: > > > > It seams that the own scrip is opening a second > session from the beginning. > Also is he probably waiting for the prompt. > > How ever, on this dialogis hanging my script (line > 15: $ssh->shell();). If I > don't use the shell mode than I run in another > problem by applying a command > (ERROR: Only interactive login supported). > > > > I need to know: > > * how satisfy this dialog? > > * suppress the message > > IO::Socket::INET at > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line > 295 > > IO::String at > C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 > > > > Here the scrip output > > ################################################################## > > ... > > IO::String at > C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 > > IO::Socket::INET at > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 > > IO::String at > C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 > > IO::String at > C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118 > > > > > > WARNING: There exist other CLI sessions. > > > > Current sessions (including this session): > > Logged on From > > Wed Jul 26 12:57 192.168.1.42 > > unknown unknown > > > > Kill other sessions (yes/no) [no]: IO::Socket::INET > at > C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 > > IO::String at > C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 > > ################################################################## > > > > > > Here the test script it self > > ################################################################## > > #!/usr/local/bin/perl > > use strict; > > use warnings; > > use Net::SSH::W32Perl; > > STDOUT->autoflush(1); > > > > my $ssh = new Net::SSH::W32Perl('192.168.1.102', > debug => 1); > > $ssh->login('admin', 'go'); > > $ssh->shell(); > > > > my ($out, $err, $exit) = $ssh->cmd('/inf'); > > print "OUTPUT: $out\n"; > > print "ERROR: $err\n"; > > print "EXIT_code: $exit\n"; > > ################################################################## > > > > thanks > > Markus > > > > > > > ------------------------------------------------------------------------- > 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 > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
From: Markus <ma...@ni...> - 2006-08-01 12:06:16
|
I try to manage VPN gateway by using SSH, which using a readhat kernel.
During the login process is possible to run in to a dialog which needs to be
answered.
The dialog looks like this:
WARNING: There exist other CLI sessions.
Current sessions (including this session):
Logged on From
Wed Jul 26 11:41 192.168.1.36
Wed Jul 26 11:41 192.168.1.37
Kill other sessions (yes/no) [no]:
It seams that the own scrip is opening a second session from the beginning.
Also is he probably waiting for the prompt.
How ever, on this dialogis hanging my script (line 15: $ssh->shell();). If I
don't use the shell mode than I run in another problem by applying a command
(ERROR: Only interactive login supported).
I need to know:
* how satisfy this dialog?
* suppress the message
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line
295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
Here the scrip output
##################################################################
...
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118
WARNING: There exist other CLI sessions.
Current sessions (including this session):
Logged on From
Wed Jul 26 12:57 192.168.1.42
unknown unknown
Kill other sessions (yes/no) [no]: IO::Socket::INET at
C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
##################################################################
Here the test script it self
##################################################################
#!/usr/local/bin/perl
use strict;
use warnings;
use Net::SSH::W32Perl;
STDOUT->autoflush(1);
my $ssh = new Net::SSH::W32Perl('192.168.1.102', debug => 1);
$ssh->login('admin', 'go');
$ssh->shell();
my ($out, $err, $exit) = $ssh->cmd('/inf');
print "OUTPUT: $out\n";
print "ERROR: $err\n";
print "EXIT_code: $exit\n";
##################################################################
thanks
Markus
|
|
From: lalitha v. <lal...@ya...> - 2006-07-26 20:09:33
|
Hi I am a newbie to working with perl modules for load/job scheduling across clusters. I am trying to use Net::SSH::Perl to check whether I am able to connect to one of the nodes in our cluster before sending a job to it. I am using it in tandem with the CPAN module , Schedule::Load. Hence for the node with the most resources available,(provided by Schedule::Load), I wish to check whether the node is still accepting incoming SSH connections using Net::SSH.I am trying to schedule upto 40,000 different jobs on a cluster of 35 nodes. Due to system settings and certain nodes being more occupied than the other, when Schedule::Node presistently returns a certain node as the "best node" for running a job, I sometimes find that the node does not accept incoming ssh connections (possibly due to the large number of ssh connections already open). I would appreciate if you could let me know whether any of Net::SSH's functions return an error message which tell me whether the node is PRESENTLY accepting incoming ssh connections or is throwing a msg "Connection closed by remote host" Thanks Viswanath __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
|
From: Eric L. <net...@er...> - 2006-07-10 02:08:34
|
> > on the server I assume? Why do I need to do that when I can > log in by hand? Is logging in by hand not PasswordAuthentication? If you can login by hand using a password then you don't need to worry about your sshd_config. That's not the problem. > > To speed up the whole connection install Math::Pari & > > Math::BigInt::GMP. > > I have those already... as well as Math::BigInt and > IO::Handle - any other suggestions as to it being very slow > and cpu intensive (in the script only, not by hand)? > When you installed, did you make sure you had all of the crypt modules installed without errors? If you don't have the proper crypt module installed your script will not authenticate properly with the server and will chew up a lot of cpu trying. You may also want to try Net::SSH2 which is supposed to be much faster than Net::SSH::Perl. |
|
From: Iain B. <ia...@ne...> - 2006-07-10 01:35:46
|
On Fri, 2006-07-07 at 08:06 +0200, Frank Hofmann wrote: > Hi Iain, > > you need to set "PasswordAuthentication yes" in your sshd_config. > Then the login should work. on the server I assume? Why do I need to do that when I can log in by hand? Is logging in by hand not PasswordAuthentication? > To speed up the whole connection install Math::Pari & > Math::BigInt::GMP. I have those already... as well as Math::BigInt and IO::Handle - any other suggestions as to it being very slow and cpu intensive (in the script only, not by hand)? thanks for the tips, -- Iain Buchanan <iaindb at netspace dot net dot au> FLASH! Intelligence of mankind decreasing. Details at ... uh, when the little hand is on the .... |
|
From: Eric L. <net...@er...> - 2006-07-06 04:47:32
|
> -----Original Message-----
> From: ssh...@li...
> [mailto:ssh...@li...] On
> Behalf Of Iain Buchanan
> Sent: Wednesday, July 05, 2006 7:55 PM
> To: ssh...@li...
> Subject: [Ssh-sftp-perl-users] ssh authentication / cipher /
> ? can't log in
>
> Hi all,
>
> sorry for the cryptic subject, but I've been chasing this for
> a few days and I can't figure out what's going on. I'm using
> Net-SSH-Perl-1.30.tar.gz
>
> Basically I'm getting a "permission denied" when I log in with
> ssh->login. I know about eval, that's not the issue.
>
>
> Heres the script:
>
> #!/usr/bin/perl -w
>
> use strict;
>
> use Net::SSH::Perl;
>
> my $ssh = Net::SSH::Perl->new('172.16.0.52', debug=>1); print
> "logging in\n"; eval {
> $ssh->login('iain', 'abcd'); # real password replaced!
> };
> if ($@) {
> die "Sftp connection failed:\n $@\n"; }
>
> print "executing ls\n";
> my($stdout, $stderr, $exit) = $ssh->cmd('ls'); print
> "stdout:\n$stdout\nstderr:\n$stderr\nexit: $exit\n"; # end of script
>
>
>
> and here's the output. I added some <*** x seconds ***> to
> show you where it uses 100% cpu and for roughly how long:
>
> orpheus: Algorithms, s->c: 3des-cbc hmac-sha1 none
> <*** 11 seconds ***>
> orpheus: Computing shared secret key.
> <*** 11 seconds ***>
> orpheus: Verifying server signature.
> <*** 13 seconds ***>
> orpheus: Authentication methods that can continue:
> publickey,keyboard-interactive.
> orpheus: Next method to try is publickey.
> Sftp connection failed:
> Permission denied at ./sshtest.pl line 10
This looks to me like a case of the really slow login that is a result of a
couple of missing modules. Check to ensure you have Math::BigInt and
IO::Handle installed. That seems to correct at least the speed issue for
most people.
Not sure about the permission denied, but you should be careful using
password authentication if you have special characters in your passwords.
That could cause some wierdness. After you install the other two modules, if
you are still having problems, you might want to try public key
authentication.
Here is an example script I use to test with although it uses public key
auth:
#/usr/bin/perl
use strict;
use Net::SSH::Perl;
use vars qw($ssh);
my @ident = ( "/home/user/.ssh/id_dsa");
my %params = (
protocol => 2,
interactive => 0,
identity_files => [@ident],
debug => 0,
options => [
"BatchMode yes",
"AuthenticationSuccessMsg no",
"ForwardX11 no",
"ForwardAgent no"
]
);
my $server = $ARGV[0];
&sshconnect($server);
my ($stdout, $stderr, $exit) = $ssh->cmd("ls");
print "$stdout\n";
if (! $ssh) {
print "Unable to establish ssh connection to: $server\n";
} else {
print "Successfully established ssh connection to: $server\n";
}
sub sshconnect {
my $server = $_[0];
our $ssh = Net::SSH::Perl->new("$server", %params);
$ssh->login("user");
}
|
|
From: Iain B. <ia...@ne...> - 2006-07-06 01:56:11
|
Hi all,
sorry for the cryptic subject, but I've been chasing this for a few days
and I can't figure out what's going on. I'm using
Net-SSH-Perl-1.30.tar.gz
Basically I'm getting a "permission denied" when I log in with
ssh->login. I know about eval, that's not the issue.
The problem is: I can't log in even with the correct username /
password. The CPU usage seems to hit 100% for a while, and eventually
fails after the debug message "Next method to try is publickey."
I checked the logs for the machine I'm ssh-ing to, and there are no
"failed log-in attempts" messages. Just to make sure, I logged in by
hand (command line) and saw the messages in the log.
I've searched all over google and the mailing list, but I still can't
find out why it's not working in my case.
Heres the script:
#!/usr/bin/perl -w
use strict;
use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new('172.16.0.52', debug=>1);
print "logging in\n";
eval {
$ssh->login('iain', 'abcd'); # real password replaced!
};
if ($@) {
die "Sftp connection failed:\n $@\n";
}
print "executing ls\n";
my($stdout, $stderr, $exit) = $ssh->cmd('ls');
print "stdout:\n$stdout\nstderr:\n$stderr\nexit: $exit\n";
# end of script
and here's the output. I added some <*** x seconds ***> to show you
where it uses 100% cpu and for roughly how long:
$ ./sshtest.pl
orpheus: Reading configuration data /home/iain/.ssh/config
orpheus: Reading configuration data /etc/ssh_config
orpheus: Connecting to 172.16.0.52, port 22.
orpheus: Remote version string: SSH-2.0-OpenSSH_4.3
orpheus: Remote protocol version 2.0, remote software version
OpenSSH_4.3
orpheus: Net::SSH::Perl Version 1.30, protocol version 2.0.
orpheus: No compat match: OpenSSH_4.3.
orpheus: Connection established.
logging in
orpheus: Sent key-exchange init (KEXINIT), wait response.
orpheus: Algorithms, c->s: 3des-cbc hmac-sha1 none
orpheus: Algorithms, s->c: 3des-cbc hmac-sha1 none
<*** 11 seconds ***>
orpheus: Entering Diffie-Hellman Group 1 key exchange.
orpheus: Sent DH public key, waiting for reply.
orpheus: Received host key, type 'ssh-dss'.
orpheus: Host '172.16.0.52' is known and matches the host key.
orpheus: Computing shared secret key.
<*** 11 seconds ***>
orpheus: Verifying server signature.
<*** 13 seconds ***>
orpheus: Waiting for NEWKEYS message.
orpheus: Enabling incoming encryption/MAC/compression.
orpheus: Send NEWKEYS, enable outgoing encryption/MAC/compression.
orpheus: Sending request for user-authentication service.
orpheus: Service accepted: ssh-userauth.
orpheus: Trying empty user-authentication request.
orpheus: Authentication methods that can continue:
publickey,keyboard-interactive.
orpheus: Next method to try is publickey.
Sftp connection failed:
Permission denied at ./sshtest.pl line 10
And lastly, when I log in with ssh by hand, it is almost
"instantaneous".
I would appreciate any tips to point me in the right direction - I tried
specifying different ciphers, different authentication methods, etc, but
the server logs don't even show an ssh failed or succeeded... The ip
address is definitely correct.
TIA,
--
Iain Buchanan <iaindb at netspace dot net dot au>
QOTD:
"She's about as smart as bait."
|
|
From: <Vee...@in...> - 2006-07-04 07:28:05
|
i have given code like this in windows
use Net::SSH::W32Perl;
my $ssh = new Net::SSH::W32Perl($host);
$ssh->login($user, $pass);
my ($out, $err, $exit) = $ssh->cmd('ls -lrt');
print "$out, $err, $exit";
while iam running perl ssh.pl it is busy,it won't give any out put or
error wht is problem ,we have to install Open ssh
for window..sugesset me
---------------------------------------------------------------------------------------------------------
Thanks & regards,
VeerendraNadh.CH
--------------------------------------------------------------------------------------------------------
Kind words may short .But their echoes are endless!
This email is confidential. If you are not the addressee tell the sender immediately and destroy this email
without using, sending or storing it. Emails are not secure and may suffer errors, viruses, delay,
interception and amendment. Standard Chartered PLC and subsidiaries ("SCGroup") do not accept liability for
damage caused by this email and may monitor email traffic.
|
|
From: Eric L. <net...@er...> - 2006-06-07 23:59:57
|
Anyone know of any reason that Net::SFTP would be sooo slow transferring files? I have been playing with a script that transfers file across a local gigabit switch and a ~150 meg file is taking more than 5 minutes, where using standard linux shell sftp it takes less than 30 seconds. All in all for all of the transfers the script needs to do the run time is almost 30 minutes. |