Net::SS...l::Auth(3)
π Net::SS...l::Auth(3) π
okay bestie so this is a page from the User Contributed Perl Documentation collection, and it's literally about the authentication guts of Net::SSH::Perl. come sit with me, we're doing this together π«Ά
β¨ NAME β¨
Net::SSH::Perl::Auth β the base authentication class, plus a whole lil toolkit of utility methods πΈ
π SYNOPSIS π
use Net::SSH::Perl::Cipher;
# Get list of supported authentication IDs.
my $supported = Net::SSH::Perl::Auth::supported();
# Translate an auth name into an ID.
my $id = Net::SSH::Perl::Auth::id($name);
# Translate an auth ID into a name.
my $name = Net::SSH::Perl::Auth::name($id);
# Get the order in which auth methods are tested.
my $order = Net::SSH::Perl::Auth::order();
like... look at her go π so much utility, so much slay.
π¦ DESCRIPTION π¦
Net::SSH::Perl::Auth is the base class for every single one of the authentication method classes β she's the mother of the house, the main character, the blueprint π
and ALSO she defines a set of utility methods that you can call either as plain functions or as object methods. flexible queen behavior, no cap β¨
π UTILITY METHODS π
supported( [ $auth_id [, $server_supports ] ])
the vibe check of auth methods, fr fr π«
- with no arguments β returns a reference to an array of the auth methods that
Net::SSH::Perlsupports. basically these are the methods that have actual workingNet::SSH::Perl::Auth::implementations. no ghost methods here bestie π» - with one argument,
$auth_idβ returns a true value if that auth method is supported byNet::SSH::Perl, and false otherwise. simple as π - with two arguments,
$auth_idand$server_supportsβ returns true if the auth represented by$auth_idis supported both byNet::SSH::Perland by the sshd server. the list of methods supported by the server lives in$server_supports, which is a bit mask sent from the server during the session identification phase π₯
and here's the tea: you can call it as a non-exported function, like
my $i_support = Net::SSH::Perl::Auth::supported();
OR as an object method of a Net::SSH::Perl::Auth object, or an object of a subclass. and bestie, when you do it that way, the first argument should be $server_supports, not the $auth_id β yes it's giving plot twist but that's just how she is π
if ($auth->supported($server_supports)) {
print "Server supports auth method $auth";
}
id( [ $auth_name ] )
translates an auth method name into an ID β which is suitable for sending to the sshd server, for example π
- if given
$auth_name, translates that name into the corresponding ID - if called as an object method, translates the object's auth class name into the ID
name( [ $auth_id ] )
the reverse glow-up: translates an auth method ID into a name π
- if given
$auth_id, translates that ID into the corresponding name - if called as an object method, returns the (stripped) object's auth class name. for example, if the object were of type
Net::SSH::Perl::Auth::Rhosts,namewould returnRhostsβ¨
auth_order()
returns a reference to an array containing auth method IDs π
these IDs describe the order in which authentication should be tested against the server. so, for example, if the array listed (2, 4, 3), then the client should test: RSA, then Rhosts-RSA, then Password authentication. the itinerary is scheduled, bestie, and she sticks to it π
π AUTH USAGE π
Net::SSH::Perl::Auth->new($auth_name, $ssh)
instantiates a brand new auth object of the type $auth_name, and hands it the Net::SSH::Perl object $ssh π«Ά
that $ssh object should contain an open connection to an sshd server β no connection, no party.
returns the auth object, which will be blessed into the actual auth subclass. iconic class inheritance moment π
$valid = $auth->authenticate()
talks to the sshd server to authenticate the user π£οΈ
- if valid β returns true
- if invalid β returns false
that's it, that's the whole dramatic exchange π
πΈ AUTH DEVELOPMENT πΈ
if you're out here writing classes that implement an authentication method, you must implement these following two methods. non-negotiable, bestie, it's the law β
$class->new($ssh)β given aNet::SSH::Perlobject$ssh, should construct a new auth object and bless it into$class, presumably. (the "presumably" is doing a lot of heavy lifting here and honestly? same π)$class->authenticate()β authenticate the current user with the remote daemon. this requires following the messaging protocol defined for your authentication method. all of the data you need β user name, password (if required), etc. β should be in the$sshobject. returns1if the authentication is successful,0otherwise β
β οΈ like genuinely, follow the messaging protocol for your method. it's not optional and she will notice.
π AUTHOR & COPYRIGHTS π
please see the Net::SSH::Perl manpage for author, copyright, and license information. all the legal girly details live over there, i'm just the messenger π
and that's the whole page, bestie!! no cap, you now know auth better than half the people who claim they do π§
this was perl v5.42.0, dated 2026-01-17, brought to you by the fine folks at Net::SS...l::Auth(3). mwah, go slay π
β¨
π¦ where this page comes from
- fedora 44: perl-Net-SSH-Perl 2.144-2.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms