Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Selected cipher type not supported by server

2 views
Skip to first unread message

lovecreatesbea...@gmail.com

unread,
May 8, 2008, 6:50:52 AM5/8/08
to
Hi,

I'm getting "Selected cipher type not supported by server" error on
this line

$cnn = Net::SSH::Perl->new($host);

The error occurs even when I specify all IDEA, DES, DES3, Blowfish,
arcfour, blowfish-cbc, and 3des-cbc like this:

$cnn = Net::SSH::Perl->new($host, cipher => "IDEA");

in the following script. How can I correct this?


Thank you for your time.

#!/usr/bin/perl

use Net::SSH::Perl;
my ($host, $user, $pass, $mgrip, $rpwd, $prmpt, $tmout, $line);
$host = $ARGV[0];
$user = $ARGV[1];
$pass = $ARGV[2];
$mgrip = $ARGV[3];
$rpwd = $ARGV[4];
$prmpt = '/[\$%#>] ?$/';
$tmout = 2;

$cnn = Net::SSH::Perl->new($host);
$cnn->login($user, $pass);
#$cnn->print("/bin/su -");
#$cnn->waitfor('/password: ?$/i');
#$cnn->print($rpwd);
#$cnn->prompt('/# $/');
#$cnn->waitfor($cnn->prompt);
#@line = $cnn->cmd("/usr/sbin/dasnmp -a $mgrip");
@line = $cnn->cmd("ls /");
print "@line\n";

lovecreatesbea...@gmail.com

unread,
May 8, 2008, 6:59:02 AM5/8/08
to
On May 8, 6:50 pm, "lovecreatesbea...@gmail.com"

And these commented lines,

#$cnn->print("/bin/su -");
#$cnn->waitfor('/password: ?$/i');
#$cnn->print($rpwd);
#$cnn->prompt('/# $/');
#$cnn->waitfor($cnn->prompt);
#@line = $cnn->cmd("/usr/sbin/dasnmp -a $mgrip");

I used them to perform su root when the cnn was an telnet connection.
The print, waitfor and prompt come from telnet can not be used in ssh
connection in my code.

How can I su root in ssh connection?

Dr.Ruud

unread,
May 8, 2008, 10:19:39 AM5/8/08
to
lovecreatesbea...@gmail.com schreef:

> #!/usr/bin/perl

Missing:
use strict;
use warnings;


> use Net::SSH::Perl;
> my ($host, $user, $pass, $mgrip, $rpwd, $prmpt, $tmout, $line);
> $host = $ARGV[0];
> $user = $ARGV[1];
> $pass = $ARGV[2];
> $mgrip = $ARGV[3];
> $rpwd = $ARGV[4];
> $prmpt = '/[\$%#>] ?$/';
> $tmout = 2;

You can write that as:

my ($host, $user, $pass, $mgrip, $rpwd) = @ARGV;
my $prmpt = qr/[\$%#>] ?$/;
my $tmout = 2;

I don't see $prmpt nor $line used anywhere.

--
Affijn, Ruud

"Gewoon is een tijger."

smallpond

unread,
May 8, 2008, 11:09:47 AM5/8/08
to
lovecreatesbea...@gmail.com wrote:
> Hi,
>
> I'm getting "Selected cipher type not supported by server" error on
> this line
>
> $cnn = Net::SSH::Perl->new($host);
>

Are you tring to connect to an SSH-1 or SSH-2 host?
If not sure, report the error(s) you get from trying each.
--S
** Posted from http://www.teranews.com **

lovecreatesbea...@gmail.com

unread,
May 8, 2008, 11:42:22 PM5/8/08
to
On May 8, 11:09 pm, smallpond <smallp...@juno.com> wrote:
> lovecreatesbea...@gmail.com wrote:
> > Hi,
>
> > I'm getting "Selected cipher type  not supported by server" error on
> > this line
>
> >     $cnn = Net::SSH::Perl->new($host);
>
> Are you tring to connect to an SSH-1 or SSH-2 host?
> If not sure, report the error(s) you get from trying each.

Hi, Thank you.

I tried the following ciphers one by one and got the same error
message: "Selected cipher type not supported by server Options ".

>> The error occurs even when I specify all IDEA, DES, DES3, Blowfish,
>> arcfour, blowfish-cbc, and 3des-cbc like this:

>> $cnn = Net::SSH::Perl->new($host, cipher => "IDEA");


I manually ssh login the host and check the version. Is OpenSSH_4.6p1
an SSH1 or SSH2 implementation, or both?

root@bx1200:/etc/ssh# ssh -V
OpenSSH_4.6p1, OpenSSL 0.9.8d 28 Sep 2006
root@bx1200:/etc/ssh#

root user ssh login is enabled defaultly, right? So I don't su root,
do I?

The Cipher lines in ssh_config file are commented out as following.
How can know its cipher settings?

root@bx1200:/etc/ssh# grep Cipher ssh_config
# Cipher 3des
# Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-
cbc,arcfour,aes192-cbc,aes256-cbc
root@bx1200:/etc/ssh#

[ Do I need to in my perl script issue "ssh -c <cipher_spec>" command
before ...? Absolutely not! I am not ssh-connected with the host. What
can I do? ]

smallpond

unread,
May 9, 2008, 11:59:35 AM5/9/08
to
lovecreatesbea...@gmail.com wrote:
> On May 8, 11:09 pm, smallpond <smallp...@juno.com> wrote:
>
>>lovecreatesbea...@gmail.com wrote:
>>
>>>Hi,
>>
>>>I'm getting "Selected cipher type not supported by server" error on
>>>this line
>>
>>> $cnn = Net::SSH::Perl->new($host);
>>
>>Are you tring to connect to an SSH-1 or SSH-2 host?
>>If not sure, report the error(s) you get from trying each.
>
>
> Hi, Thank you.
>
> I tried the following ciphers one by one and got the same error
> message: "Selected cipher type not supported by server Options ".
>
>
>>>The error occurs even when I specify all IDEA, DES, DES3, Blowfish,
>>>arcfour, blowfish-cbc, and 3des-cbc like this:
>
>
>>> $cnn = Net::SSH::Perl->new($host, cipher => "IDEA");
>
>
>
> I manually ssh login the host and check the version. Is OpenSSH_4.6p1
> an SSH1 or SSH2 implementation, or both?
>
> root@bx1200:/etc/ssh# ssh -V
> OpenSSH_4.6p1, OpenSSL 0.9.8d 28 Sep 2006
> root@bx1200:/etc/ssh#
>
> root user ssh login is enabled defaultly, right? So I don't su root,
> do I?
>

I normally disable root login, but its optional.


> The Cipher lines in ssh_config file are commented out as following.
> How can know its cipher settings?
>
> root@bx1200:/etc/ssh# grep Cipher ssh_config
> # Cipher 3des
> # Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-
> cbc,arcfour,aes192-cbc,aes256-cbc
> root@bx1200:/etc/ssh#
>
> [ Do I need to in my perl script issue "ssh -c <cipher_spec>" command
> before ...? Absolutely not! I am not ssh-connected with the host. What
> can I do? ]


The rule when you don't know what's wrong is to step back to the
earliest place that you get an error.

Most ssh supports protocol type 1 and 2 these days, but to narrow
down your problem, try each each individually. Let the cipher type
be the default for that protocol. So try each of these separately:

$cnn = Net::SSH::Perl->new($host, -protocol => '1');

$cnn = Net::SSH::Perl->new($host, -protocol => '2');

You may get a different error from each one which would be a clue
for what's wrong.

lovecreatesbea...@gmail.com

unread,
May 13, 2008, 1:26:23 AM5/13/08
to
On May 9, 11:59 pm, smallpond <smallp...@juno.com> wrote:
> lovecreatesbea...@gmail.com wrote:
> > I manually ssh login the host and check the version. Is OpenSSH_4.6p1
> > an SSH1 or SSH2 implementation, or both?
>
> The rule when you don't know what's wrong is to step back to the
> earliest place that you get an error.
>
> Most ssh supports protocol type 1 and 2 these days, but to narrow
> down your problem, try each each individually. Let the cipher type
> be the default for that protocol. So try each of these separately:
>
> $cnn = Net::SSH::Perl->new($host, -protocol => '1');
>
> $cnn = Net::SSH::Perl->new($host, -protocol => '2');
>
> You may get a different error from each one which would be a clue
> for what's wrong.

Hi, thank you very much. When I specified protocol => '2' explicitly,
I was prompted with the message of missing perl modules:

my $ssh = Net::SSH::Perl->new("192.168.50.50", protocol => '2');
$ssh->login($user, $pass);
$ssh->cmd("hostname");
### Can't locate Math/Pari.pm in @INC

When I used `protocol=>'1' or didn't specify that parameter then I got
"Selected cipher type not supported by server Options". I downloaded
those from cpan and had them installed. Now it works.

Before I tried this successfully, I ever went to except script but
failed at last. So, thank you very much.

smallpond

unread,
May 13, 2008, 10:51:16 AM5/13/08
to


It seems like in the last 30 years I haven't learned much about
programming, but I have learned about debugging. It tells you
where I spend most of my time.

0 new messages