Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Remote SSH to linux Server without using Module

by kroach (Pilgrim)
on Aug 20, 2015 at 18:41 UTC ( #1139347=note: print w/replies, xml ) Need Help??


in reply to Remote SSH to linux Server without using Module

You can open an ssh connection with a pipe:

my ($user, $host) = ('me', 'host.domain'); open my $SSH, '|-', 'ssh', join '@', $user, $host;

Then you can send commands to ssh with print:

print $SSH "mv *.back backups/"; print $SSH "echo 'Moved backups' >> log";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1139347]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2020-10-21 12:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (216 votes). Check out past polls.

    Notices?