auto login to remote server using Net::SSH::Expect
--000e0cd48470a19380049cee5db6
Content-Type: text/plain; charset=ISO-8859-1
Hi
i am able to run a command on the remote machine but i am not able to
completely login to the remote machine
=============================
use Net::SSH::Expect;
my $ssh = Net::SSH::Expect->new (
host => "1.1.1.1" ,
password=> "password",
user => "user1",
raw_pty => 1
);
myl $login_output = $ssh->login();
print "This is the login promt $login_output";
print "\n";
======================
thanks for all the help
--
Regards
Agnello D'souza
--000e0cd48470a19380049cee5db6--
Re: auto login to remote server using Net::SSH::Expect
--20cf30433eda3ac223049cf6cae2
Content-Type: text/plain; charset=UTF-8
1. What error message do you get
2. Could you try the script with strict and warnings.
3. Could you also use die and $!
4. Did you check sshd logs on the server
~Parag
On Tue, Feb 22, 2011 at 11:51 PM, Agnello George
<agnello.dsouza [at] gmail.com>wrote:
> Hi
>
> i am able to run a command on the remote machine but i am not able to
> completely login to the remote machine
>
> =============================
> use Net::SSH::Expect;
>
> my $ssh = Net::SSH::Expect->new (
> host => "1.1.1.1" ,
> password=> "password",
> user => "user1",
> raw_pty => 1
> );
>
> myl $login_output = $ssh->login();
> print "This is the login promt $login_output";
> print "\n";
>
>
> ======================
>
> thanks for all the help
>
> --
> Regards
> Agnello D'souza
>
--20cf30433eda3ac223049cf6cae2--
Re: auto login to remote server using Net::SSH::Expect
On Feb 23, 8:51=A0am, agnello.dso... [at] gmail.com (Agnello George) wrote:
> Hi
>
> i am able to run =A0a command on the remote machine but i am not able to
> completely login to the remote machine
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=
=3D=3D=3D=3D=3D
> use Net::SSH::Expect;
>
> my $ssh =3D Net::SSH::Expect->new (
> =A0 =A0 =A0 host =3D> "1.1.1.1" ,
> =A0 =A0 =A0 password=3D> "password",
> =A0 =A0 =A0 user =3D> "user1",
> =A0 =A0 =A0 raw_pty =3D> 1
> =A0 =A0 =A0 );
>
> myl $login_output =3D $ssh->login();
> print "This is the login promt $login_output";
> print "\n";
>
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D
>
> thanks for all the help
>
> --
> Regards
> Agnello D'souza
Hi,
first, what is your output? Maybe the problem is that your host uses
specific port. Try to add this:
port =3D> specific_port_number
Regards!
--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/