Re: using Net::SSH::Perl: problem with Math::Pari
by tachyon-II (Chaplain) on May 07, 2008 at 05:37 UTC
|
| [reply] |
|
Hello,
well I tool a look at it, but I'm not able to use this information:
— I have no GP/PARI directory on my system
— I have no kernel*.o files in my libPARI directory
I think there is something I don't understand at all.
I'll try Net::SSH. Thank you for your answer!
| [reply] |
|
The error seems to occur when different compilers have compiled the OS and Perl. Net::SSH ought to work without problems but if you need to install Net::SSH::Perl on approach would be to compile your own Perl from source, then install Math::Pari (it will pull down lib pari itself for you) and then Net::SSH::Perl.
| [reply] |
|
|
|
Re: using Net::SSH::Perl: problem with Math::Pari
by derby (Abbot) on May 07, 2008 at 11:38 UTC
|
It appears to be a Net::SSH week! I would recommend Net::SSH2 over both Net::SSH::Perl (and it's loooong chain of dependencies) and Net::SSH (which is just a thin wrapper over the ssh command line program).
I'm beginning to think (stay back!) that with this week's questions about Net::SSH and
petdance's blog about perl decentralizing, a real nice diversity site would be a *recommended* CPAN where someone (or some group) has pared down CPAN to what they consider the best selection(s). I know, I know ... "what's best for me, isn't best for you" ... "removing TMTOWTDI is bad" ... "it's not the perl way" ... "yadda yadda yadda." ... but it could have it's uses like 'Beginners CPAN' or 'Pure Perl' CPAN or 'Easy Cheesy' CPAN ... or my favorite 'Don't Make me Think' CPAN. (but then again, maybe this functionality all ready exists in the current CPAN and I'm just missing it).
Update: I'm not suggesting a CPAN replacement ... just a *filter* of CPAN ... under the covers, it would still be CPAN.
| [reply] |
Re: using Net::SSH::Perl: problem with Math::Pari
by sgt (Deacon) on May 07, 2008 at 22:42 UTC
|
Humm, you say you are on Un*x. Why not qx(ssh host command)? or is it that you wished to use Net::SSH::Perl mainly to bend authorization (passwd, certs etc) rules
cheers --stephan
| [reply] |
|
I don't understand what you mean with bending the authoriation rules...
I just want a script able to log in via ssh2 periodically as a cron job, so not requesting any user interaction.
| [reply] |
|
Well, first you are aware that 'ssh host command' runs command on host, aren't you. If certificates have been set up you will not be prompted for a passwd. So this would be suitable for cron. Note that command will be executed by the system shell, so you can actually use perl on the local side to build a (shell) script. You could also scp the command (or script) and then execute it remotely.
Now if the remote sshd asks for a passwd, you'll need to pass the passwd using expect for example (Perl module or command), or tweak pssh the client that comes with Net::Ssh::Perl so that it can read the passwd from a file o env_var o whatever.
Finally there are security implications doing the latter.
As an example I'll show you a remote uname -a using expect and ssh:
#!/bin/expect -f
spawn "ssh -l my_user remote_host uname -a\r"
expect -re "[Pp]assword: "
send "my_passwd\r"
cheers
--stephan
| [reply] [d/l] |
Re: using Net::SSH::Perl: problem with Math::Pari
by mvcorrea (Novice) on Jun 25, 2010 at 17:12 UTC
|
The way I manage to install Net::SSH::Perl thru hand installing Math::Pari on a Debian System
download
ftp://megrez.math.u-bordeaux.fr/pub/pari/unix/OLD/pari-2.1.7.tgz
http://search.cpan.org/CPAN/authors/id/I/IL/ILYAZ/modules/Math-Pari-2.0305_01080604a.tar.gz
unpack everything and copy the Math-Pari folder inside the pari folder
then make Math-Pari as usual
steps:
> tar xvfz pari-2.1.7.tgz
> cd pari-2.1.7
> mv ../Math-Pari-2.0305_01080604a.tar.gz .
> tar xvfz Math-Pari-2.0305_01080604a.tar.gz
> cd Math-Pari-2.0305_01080604a
> perl Makefile.PL && make && make test && make install
> perl -MCPAN -e 'install Net::SSH::Perl'
| [reply] [d/l] |
|
HI
am using the following code
my $user = "root";
my $pass = "root";
my $host = "192.168.239.108";
my $cmd = "ls";
use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new($host);
$ssh->login($user, $pass);
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
print("$stdout, $stderr, $exit");
but am getting the bellow response
"Can't set socket non-blocking: Bad file descriptor at C:/Perl/site/lib/Net/SSH/Perl.pm line 216."
can some one tell me the reason for this response?
| [reply] |
|
| [reply] |