LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-10-2024, 03:19 AM   #1
shootmadbeka
LQ Newbie
 
Registered: Jan 2024
Posts: 1

Rep: Reputation: 0
PAM module's pam_echo messages are printed twice on console


I'm using PAM (Pluggable Authentication Modules) for authentication in my Linux system and I'm encountering an issue where messages from pam_echo are being printed twice on the console.

Here's my PAM configuration:

Code:
auth     required       pam_echo.so test1
auth     required       pam_unix.so
auth     required       pam_echo.so test
account  optional       pam_echo.so test_account
account  sufficient     pam_unix.so
password required       pam_unix.so
session  required       pam_unix.so
# to prevent to not run systemd --user for root, use trick
session  sufficient     pam_succeed_if.so  uid = 0
session  required       pam_systemd.so
In this configuration, I'm using pam_echo to print some messages during the authentication process. However, each message is being printed twice on the console.

Additionally, if I initially input an incorrect password and then subsequently provide the correct one, the messages are displayed three times, which is not the expected behavior.

Interestingly, when I use the ssh -q command, which suppresses non-error messages, each message is displayed only once, as originally intended.

I've checked and confirmed that each pam_echo line in the configuration is only being executed once, so I'm not sure why the messages are being printed twice.

Does anyone know why this might be happening and how I can ensure that the messages are only printed once?

I attempted to SSH into a host using a test user, with the expectation that the messages from my PAM configuration would only appear once on the console. Here's the command I used:

Code:
ssh dummy@<host>
After entering the password, I expected to see the following output:

Code:
dummy@<host>'s password:
test1
test
test_account
[dummy@localhost /home/dummy]
#
However, the test1, test, and test_account messages were printed twice, as shown below:

Code:
dummy@<host>'s password:
test1
test
test_account
test1
test
test_account
[dummy@localhost /home/dummy]
#
I'm unsure why this is happening, as my PAM configuration should only print these messages once.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
motd is now printed twice KenJackson Fedora 4 07-12-2018 09:34 AM
/etc/pam.d/system-auth-ac vs. /etc/pam.d/password-auth-ac vs. /etc/pam.d/sshd christr Red Hat 2 08-01-2014 07:08 PM
CentOS 6.2, USB printer, CUPS says printed successfully but page is not printed stase Linux - Desktop 5 07-03-2012 06:49 PM
PAM module:passwd:- how many character validate by pam library amit_pansuria Linux - General 3 10-21-2008 01:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration