PAM_RHOSTS(8)

๐Ÿ’– PAM_RHOSTS โ€” the rhosts PAM module ๐Ÿ’–

okay bestie, gather round, we're doing a <rainbow>Linux-PAM manual page</rainbow> today and this one is so old-school it practically smells like a server room. it's the manual page for pam_rhosts from <purple>Linux-PAM</purple>, and yes we're gonna read the whole thing together. no skimming. i will know. ๐Ÿ‘€


โœจ NAME โœจ

pam_rhosts โ€” the rhosts PAM module ๐ŸŽ€


โœจ SYNOPSIS โœจ

pam_rhosts.so

that's it. that's the whole synopsis. she's lowkey minimal, she's highkey iconic. ๐Ÿ’…


โœจ DESCRIPTION โœจ

okay so this module does the standard network authentication for services โ€” you know, the whole classic vibe used by traditional implementations of rlogin and rsh etc. ๐Ÿฆ‹

the way this authentication mechanism works is it's based on the contents of two files: /etc/hosts.equiv and ~/.rhosts. let's break it down, bestie:

  • First off, hosts listed in /etc/hosts.equiv are treated as equivalent to the localhost. like, "you're basically us now, come in." ๐Ÿซถ
  • Secondly, entries in the user's own copy of ~/.rhosts are used to map "remote-host remote-user" pairs to that user's account on the current host.

access gets granted to the user if:

  1. their host is present in /etc/hosts.equiv and their remote account is identical to their local one, or
  2. their remote account has an entry in their personal configuration file.

periodt. ๐Ÿ’…

now, the module authenticates a remote user (internally specified by the item PAM_RUSER) connecting from the remote host (internally specified by the item PAM_RHOST). and this is the important part, so listen up bestie: for applications to be compatible with this authentication module, they must set these items prior to calling pam_authenticate(). ๐Ÿšจ

not me being dramatic but: the module is not capable of independently probing the network connection for such information. it cannot do that. it will not do that. it's simply not that girl. ๐Ÿ™ˆ

โœจ OPTIONS โœจ

here's the lil menu of things you can pass her, ngl it's a short one and we love that for her:

  • debug โ€” Print debug information. (she's telling you everything, oversharing era ๐Ÿ’€)
  • silent โ€” Don't print informative messages. (the opposite vibe, mysterious, quiet, lowkey ๐ŸŽ€)
  • superuser=account โ€” Handle account as root. ๐Ÿ‘‘

โœจ MODULE TYPES PROVIDED โœจ

Only the auth module type is provided. one type. that's the whole roster. she's specialized, she's focused, she's not trying to be everything to everyone. ๐ŸŒธ


โœจ RETURN VALUES โœจ

here's what she can hand back to you when things go sideways:

  • PAM_AUTH_ERR โ€” The remote host, remote user name or the local user name couldn't be determined, or access was denied by the .rhosts file. ๐Ÿ˜ญ (something's missing or you got told no)
  • PAM_USER_UNKNOWN โ€” User is not known to system. ๐Ÿ’€ (the system literally does not know this person)

โœจ EXAMPLES โœจ

okay so say you wanna grant a remote user access by /etc/hosts.equiv or .rhosts for rsh โ€” you'd add the following lines to /etc/pam.d/rsh:

#%PAM-1.0
#
auth     required       pam_rhosts.so
auth     required       pam_nologin.so
auth     required       pam_env.so
auth     required       pam_unix.so

copy it exactly, bestie, don't get creative with the spacing, i'm begging. ๐Ÿ™


โœจ SEE ALSO โœจ

go read these next, the girls that read together stay together:


โœจ AUTHOR โœจ

pam_rhosts was written by Thorsten Kukuk <kukuk@thkukuk.de> โ€” thank you king, we appreciate you ๐Ÿซถ๐Ÿ‘‘


and that's the whole page, bestie!! this was <hotpink>Linux-PAM</hotpink>'s PAM_RHOSTS(8), dated 09/27/2026 โ€” yeah that date is giving time traveler but we don't question the versioning, we just respect it. ๐ŸŒˆโœจ mwah, go secure your rsh configs responsibly, ily, bye!! ๐Ÿ’–๐Ÿฆ‹๐ŸŽ€

๐Ÿ“ฆ where this page comes from