1Net::SSH::Perl::Auth(3)User Contributed Perl DocumentatioNnet::SSH::Perl::Auth(3)
2
3
4

NAME

6       Net::SSH::Perl::Auth - Base authentication class, plus utility methods
7

SYNOPSIS

9          use Net::SSH::Perl::Cipher;
10
11          # Get list of supported authentication IDs.
12          my $supported = Net::SSH::Perl::Auth::supported();
13
14          # Translate an auth name into an ID.
15          my $id = Net::SSH::Perl::Auth::id($name);
16
17          # Translate an auth ID into a name.
18          my $name = Net::SSH::Perl::Auth::name($id);
19
20          # Get the order in which auth methods are tested.
21          my $order = Net::SSH::Perl::Auth::order();
22

DESCRIPTION

24       Net::SSH::Perl::Auth provides a base class for each of the
25       authentication method classes. In addition, it defines a set of utility
26       methods that can be called either as functions or object methods.
27

UTILITY METHODS

29   supported( [ $auth_id [, $server_supports ] ])
30       Without arguments, returns a reference to an array of auth methods
31       supported by Net::SSH::Perl. These are methods that have working
32       Net::SSH::Perl::Auth:: implementations, essentially.
33
34       With one argument $auth_id, returns a true value if that auth method is
35       supported by Net::SSH::Perl, and false otherwise.
36
37       With two arguments, $auth_id and $server_supports, returns true if the
38       auth represented by $auth_id is supported both by Net::SSH::Perl and by
39       the sshd server. The list of methods supported by the server should be
40       in $server_supports, a bit mask sent from the server during the session
41       identification phase.
42
43       Can be called either as a non-exported function, i.e.
44
45           my $i_support = Net::SSH::Perl::Auth::supported();
46
47       or as an object method of a Net::SSH::Perl::Auth object, or an object
48       of a subclass (in which case the first argument should be
49       $server_supports, not the $auth_id):
50
51           if ($auth->supported($server_supports)) {
52               print "Server supports auth method $auth";
53           }
54
55   id( [ $auth_name ] )
56       Translates an auth method name into an ID (suitable for sending to the
57       sshd server, for example).
58
59       If given $auth_name translates that name into the corresponding ID. If
60       called as an object method, translates the object's auth class name
61       into the ID.
62
63   name( [ $auth_id ] )
64       Translates an auth method ID into a name.
65
66       If given $auth_id translates that ID into the corresponding name. If
67       called as an object method, returns the (stripped) object's auth class
68       name; for example, if the object were of type
69       Net::SSH::Perl::Auth::Rhosts, name would return Rhosts.
70
71   auth_order()
72       Returns a reference to an array containing auth method IDs. These IDs
73       describe the order in which authentication should be tested against the
74       server. So, for example, if the array listed (2, 4, 3), then the client
75       should test: RSA, then Rhosts-RSA, then Password authentication.
76

AUTH USAGE

78   Net::SSH::Perl::Auth->new($auth_name, $ssh)
79       Instantiates a new auth object of the type $auth_name, and gives it the
80       Net::SSH::Perl object $ssh, which should contain an open connection to
81       an sshd server.
82
83       Returns the auth object, which will be blessed into the actual auth
84       subclass.
85
86   $valid = $auth->authenticate()
87       Talks to the sshd server to authenticate the user; if valid, returns
88       true, and if invalid, returns false.
89

AUTH DEVELOPMENT

91       Classes implementing an authentication method must implement the
92       following two methods:
93
94       •   $class->new($ssh)
95
96           Given a Net::SSH::Perl object $ssh, should construct a new auth
97           object and bless it into $class, presumably.
98
99       •   $class->authenticate()
100
101           Authenticate the current user with the remote daemon. This requires
102           following the messaging protocol defined for your authentication
103           method. All of the data you need--user name, password (if
104           required), etc.--should be in the $ssh object.
105
106           Returns 1 if the authentication is successful, 0 otherwise.
107

AUTHOR & COPYRIGHTS

109       Please see the Net::SSH::Perl manpage for author, copyright, and
110       license information.
111
112
113
114perl v5.32.1                      2021-01-27           Net::SSH::Perl::Auth(3)
Impressum