Smb(3pm)

✨ NAME ✨

Authen::Smb β€” a Perl extension that lets you authenticate a user against an SMB server, bestie πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

use Authen::Smb;
my $authResult = Authen::Smb::authen('myUser',
                                     'myPassword',
                                     'myPDC',
                                     'myBDC',
                                     'myNTDomain');

if ( $authResult == Authen::Smb::NO_ERROR ) {
  print "User successfully authenticated.\n";
} else {
  print "User not authenticated with error level $authResult\n";
}

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so Authen::Smb is literally here to authenticate a user against an NT domain, no cap πŸ’… You get to specify both a primary and a backup server to use for authentication, which is giving ✨redundancy✨ energy. And when you're specifying those servers, use the NT names of the machines β€” that's the vibe, iykyk.

An authentication request will return one of four values:

  • NTV_NO_ERROR (0)
  • NTV_SERVER_ERROR (1)
  • NTV_PROTOCOL_ERROR (2)
  • NTV_LOGON_ERROR (3)

NTV_NO_ERROR is the only return value possible for a successful authentication β€” like, the one single W. Every other return value indicates failure, of one sort or another 😭 Periodt.


🌸 EXPORT_OK constants 🌸

These ones are available for export, mwah 🫢:

NTV_LOGON_ERROR
NTV_NO_ERROR
NTV_PROTOCOL_ERROR
NTV_SERVER_ERROR

πŸ‘‘ AUTHOR πŸ‘‘

Patrick Michael Kane, modus@pr.es.to β€” based on the smbval library from the samba package. Iconic, honestly πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯


ngl bestie, keep this page bookmarked β€” your future self will thank you πŸŽ€

that's it, that's the whole manual β€” brought to you by perl v5.42.3, dated 2026-08-19. slay, bye πŸ’…βœ¨

πŸ“¦ where this page comes from