|
Posted by lovecreatesbea...@gmail.com on May 8, 2008, 6:59 am
Please log in for more thread options
On May 8, 6:50=A0pm, "lovecreatesbea...@gmail.com"
> Hi,
>
> I'm getting "Selected cipher type =A0not supported by server" error on
> this line
>
> =A0 =A0 $cnn =3D 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:
>
> =A0 =A0 $cnn =3D Net::SSH::Perl->new($host, cipher =3D> "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 =A0 =3D $ARGV[0];
> $user =A0 =3D $ARGV[1];
> $pass =A0 =3D $ARGV[2];
> $mgrip =A0=3D $ARGV[3];
> $rpwd =A0 =3D $ARGV[4];
> $prmpt =A0=3D '/[$%#>] ?$/';
> $tmout =A0=3D 2;
>
> $cnn =3D 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 =3D $cnn->cmd("/usr/sbin/dasnmp -a $mgrip");
> @line =3D $cnn->cmd("ls /");
> print "@line\n";
And these commented lines,
#$cnn->print("/bin/su -");
#$cnn->waitfor('/password: ?$/i');
#$cnn->print($rpwd);
#$cnn->prompt('/# $/');
#$cnn->waitfor($cnn->prompt);
#@line =3D $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?
|