GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::SSH::Mechanize::Session(3) User Contributed Perl Documentation Net::SSH::Mechanize::Session(3)

Net::SSH::Mechanize::Session - manage a running ssh process.

version 0.1.3

This class represents a sunning "ssh" process. It is a subclass of "AnyEvent::Subprocess::Running", with methods to manage the authentication and other interaction with the sub-process.

Typically you will not create one directly, but obtain one via "Net::SSH::Mechanize::Session->login", or "Net::SSH::Mechanize->session"

You might invoke methods directly, or via "Net::SSH::Mechanize" instance's methods which delegate to the instance's "session" attribute (which is an instance of this class).

   use Net::SSH::Mechanize;

   my $mech = Net::SSH::Mechanize->new(hostname => 'somewhere');

   my $session = $mech->session;
   # ...

Creates a new instance. Not intended for public use. Use "Net::SSH::Mechanize->session" instead.

This is a read-only accessor for the "connection_params" instance passed to the constructor by "Net::SSH::Mechanize".

This is a read-write accessor to the log-in timeout parameter passed to the constructor.

If you plan to modify it, do so before "->login" or "->login_async" has been invoked or it will not have any effect on anything.

Note, all of these will throw an exception if used before "->login" or before "->login_async" has successfully completed, except of course "->login" and "->login_async" themselves. These latter methods do nothing after the first invocation.

This method logs into the remote host using the defined connection parameters, and returns a "Net::SSH::Mechanize::Session" instance on success, or throws an exception on failure.

It is safe to use in "AnyEvent" applications or "Coro" co-routines, because the implementation is asynchronous and will not block the whole process.

This is an asynchronous method used to implement the synchronous "->login" method. It returns an AnyEvent::CondVar instance immediately, which can be used to wait for completion, or register a callback to be notified when the log-in has completed.

Logs out of the remote host by issuing an "exit" command.

The returns a condvar immediately, which can be used to wait for successful completion (or otherwise) of the command(s) defined by $command.

This invokes the command(s) defined by $command on the remote host, and returns the result.

The returns a condvar immediately, which can be used to wait for successful completion (or otherwise) in a sudo'ed sub-shell of the command(s) defined by $command.

A password is required in "connection_params" for this to authenticate with sudo.

This invokes the command(s) defined by $command in a sudo'ed sub-shell on the remote host, and returns the result.

Nick Stokoe "<wulee@cpan.org>"

Copyright (c) 2011, Nick Stokoe "<wulee@cpan.org>". All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

2022-04-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.