<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dikapediav2.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Pam</id>
	<title>Pam - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://dikapediav2.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Pam"/>
	<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Pam&amp;action=history"/>
	<updated>2026-05-15T09:20:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Pam&amp;diff=146&amp;oldid=prev</id>
		<title>Ardika Sulistija: Created page with &quot; ====Pam_unix====  pam_unix - Module for traditional password authentication  https://linux.die.net/man/8/pam_unix   You want to restrict Linux users from using previous 5 passwords when changing the password. As clarified over the chat, this is a system admin task outside of AWS scope of support. To assist you on best-effort basis, I found the link [1] with the steps to do the same. I was able to replicate it in my lab successfully using the following steps for Red Hat...&quot;</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Pam&amp;diff=146&amp;oldid=prev"/>
		<updated>2024-09-11T14:19:55Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; ====Pam_unix====  pam_unix - Module for traditional password authentication  https://linux.die.net/man/8/pam_unix   You want to restrict Linux users from using previous 5 passwords when changing the password. As clarified over the chat, this is a system admin task outside of AWS scope of support. To assist you on best-effort basis, I found the link [1] with the steps to do the same. I was able to replicate it in my lab successfully using the following steps for Red Hat...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
====Pam_unix====&lt;br /&gt;
&lt;br /&gt;
pam_unix - Module for traditional password authentication &lt;br /&gt;
https://linux.die.net/man/8/pam_unix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You want to restrict Linux users from using previous 5 passwords when changing the password. As clarified over the chat, this is a system admin task outside of AWS scope of support. To assist you on best-effort basis, I found the link [1] with the steps to do the same. I was able to replicate it in my lab successfully using the following steps for Red Hat 7.8&lt;br /&gt;
&lt;br /&gt;
1- Determine if the system is using pam_unix.so or pam_unix2.so files. My instance was using pam_unix.so&lt;br /&gt;
&lt;br /&gt;
# find / -iname &amp;quot;pam_unix.so&amp;quot;&lt;br /&gt;
/usr/lib64/security/pam_unix.so&lt;br /&gt;
&lt;br /&gt;
2- Edit /etc/pam.d/system-auth and append remember=5 to the following password line&lt;br /&gt;
&lt;br /&gt;
password    sufficient    pam_unix.so sha512 shadow nullok try_first_pass use_authtok remember=5&lt;br /&gt;
&lt;br /&gt;
3- Set password aging - I skipped this step&lt;br /&gt;
&lt;br /&gt;
4- Create the file /etc/security/opasswd and confirm its permissions:&lt;br /&gt;
&lt;br /&gt;
# [ ! -f /etc/security/opasswd ] &amp;amp;&amp;amp; touch /etc/security/opasswd&lt;br /&gt;
&lt;br /&gt;
#ls -lZ /etc/security/opasswd&lt;br /&gt;
-rw-------. root root system_u:object_r:shadow_t:s0    /etc/security/opasswd&lt;br /&gt;
&lt;br /&gt;
Then I switched my user to ec2-user and tried to change the password to the current one, and got an error:&lt;br /&gt;
&lt;br /&gt;
$ passwd&lt;br /&gt;
Changing password for user ec2-user.&lt;br /&gt;
Changing password for ec2-user.&lt;br /&gt;
(current) UNIX password: &lt;br /&gt;
New password: &lt;br /&gt;
BAD PASSWORD: The password is the same as the old one&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] https://www.cyberciti.biz/tips/how-to-linux-prevent-the-reuse-of-old-passwords.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Unable to login via console but you can SSH====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I experienced this on RHEL7&lt;br /&gt;
&lt;br /&gt;
If you are able to SSH into your VM over putty but you are unable to login via the console (in hyper-V, for example), you may get the error: &amp;lt;b&amp;gt;FAILED LOGIN SESSION FROM tty1 FOR &amp;lt;user&amp;gt;, Module is unknown&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This issue likely due to the configuration of your &amp;lt;b&amp;gt;/etc/pam.d/login&amp;lt;/b&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
To fix this remove the following line from the &amp;lt;b&amp;gt;/etc/pam.d/login&amp;lt;/b&amp;gt; file:&lt;br /&gt;
 auth       required     pam_securid.so&lt;br /&gt;
&lt;br /&gt;
Save the file and try again. It fixed the issue for me.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
</feed>