LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-28-2014, 11:35 PM   #1
Pooja2505
LQ Newbie
 
Registered: Feb 2014
Posts: 3

Rep: Reputation: Disabled
I am not able to recieve password by expose_authtok option of pam_exec module.


HI All,

Please answer the below query.It is very urgent.

I want to recieve the passsword given by user at login time,in a variabe to validate it against some rules.
I have read about pam_exec.so gives the password to the calling script at stdin by using expose_authtok option.

But i am not able to recieve the password in my script.Can anyone help me how can i retrieve the password given by user at login time.

Last edited by Pooja2505; 02-28-2014 at 11:36 PM. Reason: grammar mistake
 
Old 03-01-2014, 01:37 AM   #2
redd9
Member
 
Registered: Nov 2013
Location: Canada
Distribution: Ubuntu
Posts: 80
Blog Entries: 4

Rep: Reputation: 42
Well, can we see your script?
 
Old 03-01-2014, 08:17 AM   #3
Pooja2505
LQ Newbie
 
Registered: Feb 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Here is what my script looked like -

In /etc/pam.d/system-auth i have added a line for calling pam_exec.so library file -

session required pam_exec.so expose_authtok /etc/my.sh

The /etc/my.sh script contains the following -

#!/bin/bash

read password
echo "$password" > /tmp/a.txt

my.sh has 755 permissions and so does a.txt.

I know that for recieving password we should use auth instead of session but when i use auth then my script does not get called.That's why i used session.
But i have tried with auth too and by using auth also i am not able to get password.


Please help me if you know the answer or if u know another alternative to fetch linux original password.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
I am facing a problem using pam_exec.so library.I have created script for session. Pooja2505 Linux - Newbie 1 02-08-2014 07:16 AM
pam_exec run script as user that's logging in arizonagroovejet Linux - General 2 08-23-2011 02:59 AM
how can I load a kernel 2.6 module with the -f force option ? kerneluser Linux - Newbie 1 01-22-2010 01:23 AM
[SOLVED] No Root Password or Shutdown option - 9.10 bassplayer69 Ubuntu 6 10-31-2009 02:19 PM
Password option Moataz Red Hat 5 05-01-2005 10:46 AM


All times are GMT -5. The time now is 06:00 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration