CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Net::SSH::Perl ( Complex Password Fails? ): Edit Log



ezilagel
Novice

Oct 31, 2012, 10:01 AM


Views: 2050
Net::SSH::Perl ( Complex Password Fails? )

I'm attempting to write a script that logins via ssh and provides an output of a command. However, it seems that when I try to login using a complex password, it fails to authenticate. Here is an example...


The below will fail to authenticate.
If I change the password on the remote user to simple word or a word with numbers it works fine.

Any idea?


Code
#!/usr/bin/perl 

use Net::SSH::Perl;

my $host = 'x.x.x.x';
my $user = 'user';
my $password = 'P@ssw@rd!';

#-- set up a new connection
my $ssh = Net::SSH::Perl->new($host);
#-- authenticate
$ssh->login($user, $password);
#-- execute the command
my($stdout, $stderr, $exit) = $ssh->cmd("uname -a");
print "$stdout\n";


Thanks.


Edit: Output of running the script when failing..

Permission denied at script.pl line 12

(This post was edited by ezilagel on Oct 31, 2012, 12:09 PM)


Edit Log:
Post edited by ezilagel (Novice) on Oct 31, 2012, 10:02 AM
Post edited by ezilagel (Novice) on Oct 31, 2012, 11:41 AM
Post edited by ezilagel (Novice) on Oct 31, 2012, 12:09 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives