GaijinPunch has asked for the wisdom of the Perl Monks concerning the following question:
On two specific nodes, I get "Permission denied" when the script tries to log in. However, when using the shell, ssh user@host, and entering the pass when prompted always works. Dose this mean that Net::SSH::Perl is not using password authentication, and is trying to use an rsa key? I think this is a setting in the sshd_config file, but am not sure which one to be honest. I need the apache user to do the ssh'ing, so setting up keys is a bit tricky.#!/usr/bin/perl # # use Net::SSH::Perl; my $host = "mynode"; my $user = "user"; my $pass = "pass"; my $ssh = Net::SSH::Perl->new($host, options => ["RhostsAuthentication + no"]); $ssh->login($user, $pass); my ( $stdout, $stderr, $exit ) = $ssh->cmd('uptime'); chomp $stdout; print "$stdout\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SSH::Perl authentication
by u235sentinel (Hermit) on Nov 25, 2005 at 04:31 UTC |