Hello all,
I am writing a perl script a part of which is to SSH to a router, run a show command and capture the STDOUT of the command. Can I do this with a shell command?
I have tried:
However it still prompt me for a password when I run it and it does not even try to log me in as 'auser'.
Any help is appriciated.
Nick
If at first you don't succeed, don't try skydiving.
I am writing a perl script a part of which is to SSH to a router, run a show command and capture the STDOUT of the command. Can I do this with a shell command?
I have tried:
Code:
my $password = 'password';
my $user = 'auser';
my $ip = '100.152.201.22';
my $results=`"(echo $password) | ssh $user@$ip"`;
However it still prompt me for a password when I run it and it does not even try to log me in as 'auser'.
Any help is appriciated.
Nick
If at first you don't succeed, don't try skydiving.