LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-10-2013, 11:02 AM   #1
vikky
LQ Newbie
 
Registered: Apr 2012
Posts: 26
Blog Entries: 1

Rep: Reputation: Disabled
how to use NET::SSH


[root@server perl.pl]# ./perlssh.pl
Can't locate Net/SSH/Perl.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./perlssh.pl line 7.
BEGIN failed--compilation aborted at ./perlssh.pl line 7.
[root@server perl.pl]#
[root@server perl.pl]# cat perlssh.pl
#!/usr/bin/perl -w
#use strict;
#use warnings;
my $host=192.168.79.132;
my $user="root";
my $pass="redhat";
use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new($host);
$ssh->login($user, $pass);
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
[root@server perl.pl]#

can anyone please help me on this to fix it.....
 
Old 03-10-2013, 11:45 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
CentOS 5 ? Or RHEL 5.x ?

Looks like no 'perl-Net-SSH-Perl' was installed :
# yum install perl-Net-SSH-Perl

.. Provides /usr/lib/perl5/vendor_perl/5.8.8/Net/SSH/Perl.pm
etc. etc.

'perl-Net-SSH-Perl' is available from the EPEL.repo,
https://fedoraproject.org/wiki/EPEL

-
 
Old 03-10-2013, 12:25 PM   #3
vikky
LQ Newbie
 
Registered: Apr 2012
Posts: 26
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
CentOS 5 ? Or RHEL 5.x ?

Error: Missing Dependency: perl(Digest::SHA1) is needed by package perl-Crypt-DSA-0.14-7.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Digest::SHA1) is needed by package perl-Net-SSH-Perl-1.34-2.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Convert::ASN1) is needed by package perl-Convert-PEM-0.07-5.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Digest::HMAC_SHA1) is needed by package perl-Net-SSH-Perl-1.34-2.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Digest::SHA1) is needed by package perl-Crypt-RSA-1.98-3.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Compress::Zlib) is needed by package perl-Convert-ASCII-Armour-1.4-5.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Convert::ASN1) >= 0.10 is needed by package perl-Convert-PEM-0.07-5.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Compress::Zlib) is needed by package perl-Net-SSH-Perl-1.34-2.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Digest::HMAC_MD5) is needed by package perl-Net-SSH-Perl-1.34-2.el5.noarch (yumfiles)
[root@server yum.repos.d]#
[root@server yum.repos.d]#
[root@server yum.repos.d]#
[root@server yum.repos.d]#
[root@server yum.repos.d]#
[root@server yum.repos.d]# cat /etc/issue
CentOS release 5.3 (Final)
Kernel \r on an \m

root@server yum.repos.d]# cat fedora.repo
[yumfiles]
name=fedora.repo
baseurl=http://ftp.riken.jp/Linux/fedora/epel//5Server/i386/
enabled=1
gpgcheck=0


[root@server yum.repos.d]#

created repo file but still there is lots of dependencies...
 
Old 03-10-2013, 12:44 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,933

Rep: Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692
Quote:
Originally Posted by vikky View Post
Error: Missing Dependency: perl(Digest::SHA1) is needed by package perl-Crypt-DSA-0.14-7.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Digest::SHA1) is needed by package perl-Net-SSH-Perl-1.34-2.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Convert::ASN1) is needed by package perl-Convert-PEM-0.07-5.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Digest::HMAC_SHA1) is needed by package perl-Net-SSH-Perl-1.34-2.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Digest::SHA1) is needed by package perl-Crypt-RSA-1.98-3.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Compress::Zlib) is needed by package perl-Convert-ASCII-Armour-1.4-5.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Convert::ASN1) >= 0.10 is needed by package perl-Convert-PEM-0.07-5.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Compress::Zlib) is needed by package perl-Net-SSH-Perl-1.34-2.el5.noarch (yumfiles)
Error: Missing Dependency: perl(Digest::HMAC_MD5) is needed by package perl-Net-SSH-Perl-1.34-2.el5.noarch (yumfiles)
[root@server yum.repos.d]#
[root@server yum.repos.d]#
[root@server yum.repos.d]#
[root@server yum.repos.d]#
[root@server yum.repos.d]#
[root@server yum.repos.d]# cat /etc/issue
CentOS release 5.3 (Final)
Kernel \r on an \m

root@server yum.repos.d]# cat fedora.repo
[yumfiles]
name=fedora.repo
baseurl=http://ftp.riken.jp/Linux/fedora/epel//5Server/i386/
enabled=1
gpgcheck=0
created repo file but still there is lots of dependencies...
Ok..so install the dependencies. Not really another solution to the problem. And you should be able to easily install this from CPAN, with a single command. Google has lots of information on how to install it, as well as on the CPAN site. Run "sudo perl -MCPAN -e 'install Net::SSH'". It will install/compile everything from CPAN, including dependencies.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Perl and Net:SSH pratapsingh Programming 9 04-22-2011 03:39 AM
iptables limit ssh from local net robbtek Linux - Security 2 02-24-2010 06:21 PM
Accessing SSH thru the net. TRi-x2 Linux - Security 5 03-28-2004 08:48 AM
slow for ssh and can't see the net by adsl modem reaky Linux - Networking 1 02-20-2004 07:32 PM
2 computers, ssh and the net cyborg_jt Linux - Networking 7 02-03-2004 03:15 AM


All times are GMT -5. The time now is 09:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration