- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- ssh - PERL
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2006 10:08 AM
тАО02-07-2006 10:08 AM
ssh - PERL
I am using ssh in my PERL script.
The pur pose of my script is to log into a remote machine and execute a perl script there which takes a minute or so to execute. The remote perl script creates a report and I need to cp that report to my machine using "scp".
The portion of my script which does this is as following:
my $cmd = "ssh user\@password perl report.pl";
my @result = `$cmd`;
print @result;
I don't get any errors but the output is never created in the remote machine.
I just receive the message:
"Please wait while your request is getting processed" which is the message from the remote perl script while creating the output.
Even if I just use ssh from command line, I don't see any errors but the output file is not cretaed in the remote machine. Here also I just get the "Please wait" message and then it returns to the command prompt.
Can anyone please tell me how do I make the ssh session to wait till the output file is created by the perl script in the remote machine.
Thanks,javascript:postMessageSubmit('submit');
Submit
Anand
- Tags:
- ssh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2006 10:22 AM
тАО02-07-2006 10:22 AM
Re: ssh - PERL
perl has a command called system, which I use for these purposes.
You may be doing it differently, but you may wish to try that.
ssh is on the PATH?
Perhaps try the full path of this in the shell.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2006 10:27 AM
тАО02-07-2006 10:27 AM
Re: ssh - PERL
http://search.cpan.org/~ivan/Net-SSH-0.08/SSH.pm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2006 12:34 PM
тАО02-07-2006 12:34 PM
Re: ssh - PERL
system() should be outlawed in Perl shell scripts as do direct calls to commands like ssh/ftp,etc. Most common tools/utils now have their corresponding Perl Modules on CPAN.
I am starting to get serious with Perl these days and I was amazed at the many really useful modules at CPAN that were not there last time I looked ( long time...).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2006 06:35 PM
тАО02-07-2006 06:35 PM
Re: ssh - PERL
2. The problem with many, if not all, SSL/SSH related perl modules is that most are XS based modules that require to be compiled with the C compiler. That is however not the biggest problem, as the GNU gcc compiler is widely available, and causes less and less trouble with every new release.
The trouble comes with ssl/ssh related source files needing the development files of ssl/ssh, and I've seen too often that these are either not available at all, or that the wrong version is available (32bit where 64bit is needed or vice versa).
The latter causes more headaches than it solves, and warrents the use of external ssh/scp/ftp calls through system () or qx// in your scripts.
Enjoy, Have FUN! H.Merijn [ who tries to include SSH modules in his perl builds wherever possible ]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2006 06:40 PM
тАО02-07-2006 06:40 PM
Re: ssh - PERL
Net::SSH will be helpful to you,
http://www.stupidfool.org/perl/net-ssh/
http://www.stupidfool.org/perl/docs/perldoc/Net/SSH/Perl.html
Procura, how about using this module ? Or it is included in your latest Perl (5.8.8 or 5.8.7) build ?
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2006 07:25 PM
тАО02-07-2006 07:25 PM
Re: ssh - PERL
Crypt::SSLeay, Net::SSLeay, & IO::Socket::SSL
Net::SSH is not included (yet). I'll consider including it in the upcoming releases.
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2006 07:33 PM
тАО02-07-2006 07:33 PM
Re: ssh - PERL
--8<---
sub ssh {
my ($host, @command) = @_;
@ssh_options = &_ssh_options unless @ssh_options;
my @cmd = ($ssh, @ssh_options, $host, @command);
warn "[Net::SSH::ssh] executing ". join (' ', @cmd). "\n"
if $DEBUG;
system (@cmd);
}
-->8---
Which I find a bit simplistic, and certainly not good enough a reason to include this module.
A better solution would be to use Net::SSH::Perl, which is a perl implementation that does not use the external commands, but this module has too many dependancies (*) to add it to my distribution(s). So I will probably not do so.
(*) PREREQUISITES
Protocol 1
* Math::GMP (1.04 or greater)
* String::CRC32 (1.2 or greater)
* Digest::MD5
* IO::Socket
Protocol 2
* Crypt::DSA (0.03 or greater)
* Crypt::DH (0.01 or greater)
* Math::Pari (2.001804 or greater)
* MIME::Base64
* Digest::MD5
* Digest::SHA1
* Digest::HMAC_MD5
* Digest::HMAC_SHA1
* Convert::PEM (0.05 or greater)
* IO::Socket
It also optionally requires Digest::BubbleBabble for
generating bubble babble fingerprints, and Crypt::RSA
(1.37 or greater) if you want to use RSA key files in SSH2.
Note that RSA key files in SSH1 do not require Crypt::RSA.
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-08-2006 05:06 AM
тАО02-08-2006 05:06 AM
Re: ssh - PERL
I used the PERL SSH module and it worked fine. Thanks to all of you.
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-08-2006 09:10 AM
тАО02-08-2006 09:10 AM
Re: ssh - PERL
Why not using expect with ssh ? I have open a thread on it and Doug O'Leary answer me. Have a look.
Best Regards
Patrice