NAME
Net::Appliance::Session::Transport::SSH - Connections using SSH
VERSION
version 2.111080
SYNOPSIS
$s = Net::Appliance::Session->new(
Host => 'hostname.example',
Transport => 'SSH',
);
$s->connect(
Name => $username, # required
Password => $password, # required if logging in
);
DESCRIPTION
This package sets up a new pseudo terminal, connected to an SSH client running in a spawned process, which is then bound into Net::Telnet
for IO purposes.
CONFIGURATION
This module hooks into Net::Appliance::Session via its connect()
method. Parameters are supplied to connect()
in a hash of named arguments.
Prerequisites
Before calling connect()
you must have set the Host
key in your Net::Appliance::Session object, either via the named parameter to new()
or the host()
object method inherited from Net::Telnet.
Required Parameters
Name
-
A username must be passed in the
Name
parameter otherwise the call will die. This value is stored for possible later use bybegin_privileged()
. Password
-
If log-in is enabled (i.e. you have not disabled this via
do_login()
) then you must also supply a password in thePassword
parameter value. The password will be stored for possible later use bybegin_privileged()
.
Optional Parameters
SHKC
-
Setting the value for this key to any False value will disable
openssh
's Strict Host Key Checking. See theopenssh
documentation for further details. This might be useful where you are connecting to appliances for which an entry does not yet exist in yourknown_hosts
file, and you do not wish to be interactively prompted to add it.$s->connect( Name => $username, Password => $password, SHKC => 0, );
The default operation is to let
openssh
use its default setting for StrictHostKeyChecking. You can also set this option to true, of course. App
-
You can override the default location of your SSH application binary by providing a value to this named parameter. This module expects that the binary is a version of OpenSSH.
$s->connect( Name => $username, Password => $password, App => '/usr/local/bin/openssh', );
The default binary location is
/usr/bin/ssh
. Opts
-
If you want to pass any other options to
openssh
on its command line, then use this option.Opts
should be an array reference, and each item in the array will be passed toopenssh
, separated by a singe space character. For example:$s->connect( Name => $username, Password => $password, Opts => [ '-p', '222', # connect to non-standard port on remote host '-o', 'CheckHostIP=no', # don't check host IP in known_hosts file ], );
DEPENDENCIES
To be used, this module requires that your system have a working copy of the OpenSSH SSH client application installed.
AUTHOR
Oliver Gorwits <oliver@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by University of Oxford.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.