En Fedora

ruby-pam.i686 : Ruby-pam bindings exposed outside of gem
rubygem-pam.i686 : Ruby bindings for pam

rpam

# yum install pam-devel
# gem install rpam
# cd /etc/pam.d
# cp login rpam

En resumen:

1  require 'rpam'
2  include Rpam
3
4  if authpam("user","password") == true
5        puts "Authenticate Successful" 
6  else
7        puts "Authenticate Failure" 
8  end

Se limita a la autenticación de usuario via PAM.

pam

Acceso API a PAM más completo, no tiete ri/rdoc pero hay un README.

Methods
---------
service, user, item : String
conv : Proc or Symbol
msec, type, flag : Integer

  * PAM.start(service, user, conv, conv_data = nil){ ... }
  * PAM::Handle.new(service, user, conv, conv_data = nil){ ... }
  * PAM::Handle.start(service, user, conv, conv_data = nil){ ... }
  * PAM::Handle#end() -- called at the above block end.
  * PAM::Handle#status()
  * PAM::Handle#conv(msg)
  * PAM::Handle#authenticate(flag)
  * PAM::Handle#acct_mgmt(flag = 0)
  * PAM::Handle#set_fail_delay(msec)
  * PAM::Handle#setcred(flag = 0)
  * PAM::Handle#chauthtok(flag = 0)
  * PAM::Handle#open_session(flag = 0){ ... }
  * PAM::Handle#close_session(flag = 0)
  * PAM::Handle#set_item(type, item)
  * PAM::Handle#get_item(type, item)
  * PAM::Handle#strerror(errnum)
  * PAM::Handle#putenv("veriable=value")
  * PAM::Handle#getenv("veriable")

Structures
------------
  * Message (Struct) -- Message.new(msg_style, msg)
  * Response (Struct) -- Response.new(resp, resp_retcode)

Exceptions
------------
  * PAMError (Class)
  * PAM_SUCCESS
  * PAM_OPEN_ERR
  * ...
see 'pam_appl.h'

'PAM::' Constants
------------------
  * PAM_VERSION
  * PAM_MAJOR_VERSION
  * PAM_MINOR_VERSION
  * PAM_CONV
  * PAM_CHANGE_EXPIRED_AUTHTOK
  * PAM_DELETE_CRED
  * PAM_ERROR_MSG
  * PAM_ESTABLISH_CRED
  * PAM_OLDAUTHTOK
  * PAM_PROMPT_ECHO_OFF
  * PAM_PROMPT_ECHO_ON
  * PAM_REFRESH_CRED
  * PAM_REINITIALIZE_CRED
  * PAM_RHOST
  * PAM_RUSER
  * PAM_SERVICE
  * PAM_SILENT
  * PAM_TEXT_INFO
  * PAM_TTY
  * PAM_USER
  * PAM_USER_PROMPT
  * PAM_DISALLOW_NULL_AUTHTOK