Thread: [Ssh-sftp-perl-users] Problem With Net::SSH
Brought to you by:
dbrobins
From: cheerla s. <ch....@gm...> - 2009-06-10 06:52:31
|
Hi All , I am trying to do ssh to a machine from my client using the following CODE : use Net::SSH qw(sshopen2); use strict; my $user = "root"; my $host = "changeme"; my $cmd = "ls /root/"; sshopen2("$user\@$host", *READER, *WRITER, "$cmd") || die "ssh: $!"; while (<READER>) { chomp(); print "$_\n"; } close(READER); close(WRITER); When I execute this code it says "*Permission denied (publickey,keyboard-interactive)*." .Am I missing something here ? The host I am trying to login is a SUSE machine . Please suggest me the solution to get of this problem . Regards, SreeHari Ch |
From: Ian D. <Ian...@bd...> - 2009-06-10 13:13:41
|
Hi Are you able to do an SSH command from the command line to the remote host without entering a password? In other words are your public keys set up on the host correctly? Regards Ian ________________________________ From: cheerla sreehari [mailto:ch....@gm...] Sent: 10 June 2009 07:51 To: ssh...@li... Subject: [Ssh-sftp-perl-users] Problem With Net::SSH Hi All , I am trying to do ssh to a machine from my client using the following CODE : use Net::SSH qw(sshopen2); use strict; my $user = "root"; my $host = "changeme"; my $cmd = "ls /root/"; sshopen2("$user\@$host", *READER, *WRITER, "$cmd") || die "ssh: $!"; while (<READER>) { chomp(); print "$_\n"; } close(READER); close(WRITER); When I execute this code it says "Permission denied (publickey,keyboard-interactive)." .Am I missing something here ? The host I am trying to login is a SUSE machine . Please suggest me the solution to get of this problem . Regards, SreeHari Ch |
From: cheerla s. <ch....@gm...> - 2009-06-11 04:23:23
|
No .....I am not able to do SSH without entering the password . Is there any way I can automate this password . or is there any way I can give the password for NET::SSH . Please suggest me . Regards, SreeHari Ch On Wed, Jun 10, 2009 at 6:08 PM, Ian Docherty <Ian...@bd...> wrote: > Hi > > Are you able to do an SSH command from the command line to the remote host > without entering a password? > > > > In other words are your public keys set up on the host correctly? > > > > Regards > > Ian > > > ------------------------------ > > *From:* cheerla sreehari [mailto:ch....@gm...] > *Sent:* 10 June 2009 07:51 > *To:* ssh...@li... > *Subject:* [Ssh-sftp-perl-users] Problem With Net::SSH > > > > Hi All , > > I am trying to do ssh to a machine from my client using the following CODE > : > > use Net::SSH qw(sshopen2); > use strict; > > my $user = "root"; > my $host = "changeme"; > my $cmd = "ls /root/"; > > sshopen2("$user\@$host", *READER, *WRITER, "$cmd") || die "ssh: $!"; > > while (<READER>) { > chomp(); > print "$_\n"; > } > > close(READER); > close(WRITER); > > When I execute this code it says "*Permission denied > (publickey,keyboard-interactive)*." .Am I missing something here ? > > The host I am trying to login is a SUSE machine . > Please suggest me the solution to get of this problem . > > Regards, > SreeHari Ch > This email is confidential and intended solely for the use of the > individual to whom it is addressed. Any views or opinions presented are > solely those of the author and do not necessarily represent those of RedBee > Media Metadata. If you are not the intended recipient, be advised that you > have received this email in error and that any use, dissemination, > forwarding, printing, or copying of this email is strictly prohibited. If > you have received this email in error please notify the sender. > > Red Bee Media Metadata is a trading name of Broadcasting Dataservices > Limited. > Registered in England and Wales No.: 2554733. Registered Office: 201 Wood > Lane, London W12 7TP, UK. > Broadcasting Dataservices Limited is a wholly owned subsidiary of Red Bee > Media Limited. > |
From: Ian D. <Ian...@bd...> - 2009-06-11 06:52:13
|
You can't specify a password to Net::SSH (it states so in the documentation) You can either set up SSH to not require a password. You have to look up how to do password-less SSH between client and host. This involves creating a public-private keypair on the client and then installing the public key on the host. This then allows you to ssh from the client to the host without giving a password. (Google for 'passwordless ssh') Or you have to provide a password to SSH. Look at Net::SSH::Expect or Net::SSH::Perl which allows you to enter a password. Regards Ian ________________________________ From: cheerla sreehari [mailto:ch....@gm...] Sent: 11 June 2009 05:22 To: Ian Docherty Cc: ssh...@li... Subject: Re: [Ssh-sftp-perl-users] Problem With Net::SSH No .....I am not able to do SSH without entering the password . Is there any way I can automate this password . or is there any way I can give the password for NET::SSH . Please suggest me . Regards, SreeHari Ch On Wed, Jun 10, 2009 at 6:08 PM, Ian Docherty <Ian...@bd...> wrote: Hi Are you able to do an SSH command from the command line to the remote host without entering a password? In other words are your public keys set up on the host correctly? Regards Ian ________________________________ From: cheerla sreehari [mailto:ch....@gm...] Sent: 10 June 2009 07:51 To: ssh...@li... Subject: [Ssh-sftp-perl-users] Problem With Net::SSH Hi All , I am trying to do ssh to a machine from my client using the following CODE : use Net::SSH qw(sshopen2); use strict; my $user = "root"; my $host = "changeme"; my $cmd = "ls /root/"; sshopen2("$user\@$host", *READER, *WRITER, "$cmd") || die "ssh: $!"; while (<READER>) { chomp(); print "$_\n"; } close(READER); close(WRITER); When I execute this code it says "Permission denied (publickey,keyboard-interactive)." .Am I missing something here ? The host I am trying to login is a SUSE machine . Please suggest me the solution to get of this problem . Regards, SreeHari Ch This email is confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of RedBee Media Metadata. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. If you have received this email in error please notify the sender. Red Bee Media Metadata is a trading name of Broadcasting Dataservices Limited. Registered in England and Wales No.: 2554733. Registered Office: 201 Wood Lane, London W12 7TP, UK. Broadcasting Dataservices Limited is a wholly owned subsidiary of Red Bee Media Limited. This email is confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of RedBee Media Metadata. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. If you have received this email in error please notify the sender. Red Bee Media Metadata is a trading name of Broadcasting Dataservices Limited. Registered in England and Wales No.: 2554733. Registered Office: 201 Wood Lane, London W12 7TP, UK. Broadcasting Dataservices Limited is a wholly owned subsidiary of Red Bee Media Limited. |