<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.labrats.us//wiki/index.php?action=history&amp;feed=atom&amp;title=User%3ASfiggins%2FRH-DS-PAM-PTA</id>
	<title>User:Sfiggins/RH-DS-PAM-PTA - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.labrats.us//wiki/index.php?action=history&amp;feed=atom&amp;title=User%3ASfiggins%2FRH-DS-PAM-PTA"/>
	<link rel="alternate" type="text/html" href="https://www.labrats.us//wiki/index.php?title=User:Sfiggins/RH-DS-PAM-PTA&amp;action=history"/>
	<updated>2026-04-04T14:19:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://www.labrats.us//wiki/index.php?title=User:Sfiggins/RH-DS-PAM-PTA&amp;diff=54&amp;oldid=prev</id>
		<title>Sfiggins: Created page with &quot;=PAM Pass-through=  ==Setup initial control files==  &lt;pre&gt; # cat &gt; /tmp/ldap-pam-on.ldif &lt;&lt; &#039;EOF&#039; dn: cn=PAM Pass Through Auth,cn=plugins,cn=config changetype: modify replace:...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.labrats.us//wiki/index.php?title=User:Sfiggins/RH-DS-PAM-PTA&amp;diff=54&amp;oldid=prev"/>
		<updated>2018-12-13T15:28:06Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=PAM Pass-through=  ==Setup initial control files==  &amp;lt;pre&amp;gt; # cat &amp;gt; /tmp/ldap-pam-on.ldif &amp;lt;&amp;lt; &amp;#039;EOF&amp;#039; dn: cn=PAM Pass Through Auth,cn=plugins,cn=config changetype: modify replace:...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=PAM Pass-through=&lt;br /&gt;
&lt;br /&gt;
==Setup initial control files==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat &amp;gt; /tmp/ldap-pam-on.ldif &amp;lt;&amp;lt; &amp;#039;EOF&amp;#039;&lt;br /&gt;
dn: cn=PAM Pass Through Auth,cn=plugins,cn=config&lt;br /&gt;
changetype: modify&lt;br /&gt;
replace: nsslapd-pluginEnabled&lt;br /&gt;
nsslapd-pluginEnabled: on&lt;br /&gt;
-&lt;br /&gt;
replace: pamSecure&lt;br /&gt;
pamSecure: FALSE&lt;br /&gt;
-&lt;br /&gt;
replace: pamFallback&lt;br /&gt;
pamFallback: TRUE&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
# cat &amp;gt; /tmp/ldap-pam-off.ldif &amp;lt;&amp;lt; &amp;#039;EOF&amp;#039;&lt;br /&gt;
dn: cn=PAM Pass Through Auth,cn=plugins,cn=config&lt;br /&gt;
changetype: modify&lt;br /&gt;
replace: nsslapd-pluginEnabled&lt;br /&gt;
nsslapd-pluginEnabled: off&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
# ldapsearch -cx -D &amp;quot;cn=Directory Manager&amp;quot; -W -b &amp;quot;cn=plugins,cn=config&amp;quot; -h localhost &amp;gt; /tmp/config.ldif.orig&lt;br /&gt;
&lt;br /&gt;
# ldapsearch -cx -D &amp;quot;cn=Directory Manager&amp;quot; -W -b &amp;quot;cn=PAM Pass Through Auth,cn=plugins,cn=config&amp;quot; -h localhost &amp;gt; /tmp/ldap-pam.ldif.orig&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==/etc/pam.d/ldapserver Configuration for PAM-PTA==&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;/etc/pam.d/ldapserver&amp;#039;&amp;#039;&amp;#039; file needs to look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auth       include      password-auth&lt;br /&gt;
&lt;br /&gt;
account    required     pam_access.so accessfile=/etc/security/access.cron.conf&lt;br /&gt;
&lt;br /&gt;
password   include      system-auth&lt;br /&gt;
&lt;br /&gt;
session    include      system-auth&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Activate PAM-PTA==&lt;br /&gt;
&lt;br /&gt;
Apply the configuration with the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ldapsearch -cx -D &amp;quot;cn=Directory Manager&amp;quot; -W -b &amp;quot;cn=plugins,cn=config&amp;quot; -h localhost &amp;gt; /tmp/config.ldif&lt;br /&gt;
# ldapmodify -cx -D &amp;quot;cn=directory manager&amp;quot; -W -h localhost -f /tmp/ldap-pam-on.ldif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is required to restart the Directory Server to apply the configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# /etc/init.d/dirsrv restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get a dump of the current configuration settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ldapsearch -cx -D &amp;quot;cn=Directory Manager&amp;quot; -W -b &amp;quot;cn=plugins,cn=config&amp;quot; -h localhost &amp;gt; /tmp/config.ldif&lt;br /&gt;
&lt;br /&gt;
# ldapsearch -cx -D &amp;quot;cn=Directory Manager&amp;quot; -W -b &amp;quot;cn=PAM Pass Through Auth,cn=plugins,cn=config&amp;quot; -h localhost &amp;gt; /tmp/ldap-pam.ldif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
Test binding with a simple LDAP search.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ldapsearch -cx -D &amp;quot;uid=tuser2,ou=user,dc=twtelecom,dc=net&amp;quot; -W -b &amp;quot;uid=tuser2,ou=user,dc=twtelecom,dc=net&amp;quot; -h localhost&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or using this script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/perl&lt;br /&gt;
&lt;br /&gt;
use Net::LDAPS;&lt;br /&gt;
&lt;br /&gt;
$ldap_server=&amp;quot;localhost&amp;quot;;&lt;br /&gt;
$user = &amp;quot;tuser2&amp;quot;;&lt;br /&gt;
$password = &amp;quot;JbUWP3TbwdHwNou&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
$ldap_user = &amp;quot;uid=$user,ou=user,dc=twtelecom,dc=net&amp;quot;;&lt;br /&gt;
$ldap = Net::LDAPS-&amp;gt;new($ldap_server) || die &amp;quot;Unable to connect to $ldap_server: $!\n&amp;quot;;&lt;br /&gt;
$mesg = $ldap-&amp;gt;bind($ldap_user, password =&amp;gt; $password);&lt;br /&gt;
if ($mesg-&amp;gt;code) {&lt;br /&gt;
     print &amp;quot;Denied: &amp;quot;,$mesg-&amp;gt;error,&amp;quot;\n&amp;quot;;&lt;br /&gt;
} else {&lt;br /&gt;
    print &amp;quot;Granted\n&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
$mesg = $ldap-&amp;gt;unbind;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This script needs to have &amp;#039;&amp;#039;&amp;#039;perl-IO-Socket-SSL&amp;#039;&amp;#039;&amp;#039; from yum and &amp;#039;&amp;#039;&amp;#039;Net::LDAPS&amp;#039;&amp;#039;&amp;#039; from CPAN.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ./ldap-test.pl &lt;br /&gt;
Granted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=PAM_RADIUS Module=&lt;br /&gt;
&lt;br /&gt;
ftp://ftp.is.co.za/mirror/fedora.redhat.com/epel/6/x86_64/pam_radius-1.3.17-2.el6.x86_64.rpm&lt;br /&gt;
&lt;br /&gt;
==Install PAM_RADIUS (via yum)==&lt;br /&gt;
&lt;br /&gt;
This is in the EPEL channel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# yum install pam_radius&lt;br /&gt;
Loaded plugins: product-id, rhnplugin, security, subscription-manager&lt;br /&gt;
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.&lt;br /&gt;
Setting up Install Process&lt;br /&gt;
Resolving Dependencies&lt;br /&gt;
--&amp;gt; Running transaction check&lt;br /&gt;
---&amp;gt; Package pam_radius.x86_64 0:1.3.17-2.el6 will be installed&lt;br /&gt;
--&amp;gt; Finished Dependency Resolution&lt;br /&gt;
&lt;br /&gt;
Dependencies Resolved&lt;br /&gt;
&lt;br /&gt;
==============================================================================================================================================&lt;br /&gt;
 Package                        Arch                       Version                           Repository                                  Size&lt;br /&gt;
==============================================================================================================================================&lt;br /&gt;
Installing:&lt;br /&gt;
 pam_radius                     x86_64                     1.3.17-2.el6                      twtc_epel_rhel6_x86_64                      26 k&lt;br /&gt;
&lt;br /&gt;
Transaction Summary&lt;br /&gt;
==============================================================================================================================================&lt;br /&gt;
Install       1 Package(s)&lt;br /&gt;
&lt;br /&gt;
Total download size: 26 k&lt;br /&gt;
Installed size: 0  &lt;br /&gt;
Is this ok [y/N]: y&lt;br /&gt;
Downloading Packages:&lt;br /&gt;
pam_radius-1.3.17-2.el6.x86_64.rpm                                                                                     |  26 kB     00:00     &lt;br /&gt;
Running rpm_check_debug&lt;br /&gt;
Running Transaction Test&lt;br /&gt;
Transaction Test Succeeded&lt;br /&gt;
Running Transaction&lt;br /&gt;
  Installing : pam_radius-1.3.17-2.el6.x86_64                                                                                             1/1 &lt;br /&gt;
&lt;br /&gt;
Installed:&lt;br /&gt;
  pam_radius.x86_64 0:1.3.17-2.el6                                                                                                            &lt;br /&gt;
&lt;br /&gt;
Complete!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==/etc/pam_radius.conf==&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;/etc/pam_radius.conf&amp;#039;&amp;#039;&amp;#039; file needs to look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#  pam_radius_auth configuration file.  Copy to: /etc/pam_radius.conf&lt;br /&gt;
#&lt;br /&gt;
#  For proper security, this file SHOULD have permissions 0600,&lt;br /&gt;
#  that is readable by root, and NO ONE else.  If anyone other than&lt;br /&gt;
#  root can read this file, then they can spoof responses from the server!&lt;br /&gt;
#&lt;br /&gt;
#  There are 3 fields per line in this file.  There may be multiple&lt;br /&gt;
#  lines.  Blank lines or lines beginning with &amp;#039;#&amp;#039; are treated as&lt;br /&gt;
#  comments, and are ignored.  The fields are:&lt;br /&gt;
#&lt;br /&gt;
#  server[:port] secret [timeout]&lt;br /&gt;
#&lt;br /&gt;
#  the port name or number is optional.  The default port name is&lt;br /&gt;
#  &amp;quot;radius&amp;quot;, and is looked up from /etc/services The timeout field is&lt;br /&gt;
#  optional.  The default timeout is 3 seconds.&lt;br /&gt;
#&lt;br /&gt;
#  If multiple RADIUS server lines exist, they are tried in order.  The&lt;br /&gt;
#  first server to return success or failure causes the module to return&lt;br /&gt;
#  success or failure.  Only if a server fails to response is it skipped,&lt;br /&gt;
#  and the next server in turn is used.&lt;br /&gt;
#&lt;br /&gt;
#  The timeout field controls how many seconds the module waits before&lt;br /&gt;
#  deciding that the server has failed to respond.&lt;br /&gt;
#&lt;br /&gt;
# server[:port] shared_secret      timeout (s)&lt;br /&gt;
&lt;br /&gt;
66.162.108.21:1812    &amp;lt;secret_key&amp;gt;     3&lt;br /&gt;
50.58.29.21:1812      &amp;lt;secret_key&amp;gt;     3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# having localhost in your radius configuration is a Good Thing.&lt;br /&gt;
#&lt;br /&gt;
# See the INSTALL file for pam.conf hints.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==/etc/pam.d/ldapserver Configuration for PAM_RADIUS==&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;/etc/pam.d/ldapserver&amp;#039;&amp;#039;&amp;#039; configuration needs to look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auth       required     pam_env.so&lt;br /&gt;
auth       sufficient   pam_radius_auth.so conf=/etc/pam_radius_auth.conf debug&lt;br /&gt;
auth       required     pam_deny.so&lt;br /&gt;
&lt;br /&gt;
account    required     pam_access.so accessfile=/etc/security/access.cron.conf&lt;br /&gt;
&lt;br /&gt;
password   include      system-auth&lt;br /&gt;
&lt;br /&gt;
session    include      system-auth&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
&lt;br /&gt;
Testing is the same as above.&lt;/div&gt;</summary>
		<author><name>Sfiggins</name></author>
	</entry>
</feed>