All,

I'm having kind of a funky problem that I can't seem to figure out.

I want to kind of setup a two factor authentication mechanism to view a list of semi-secure data.

I'm using sudo as my first means of authentication, and then prompting the user for a passphrase to get to the actual file. Sudo is really in place to get them to verify they know the password of the account they are running the program as. (Only users in the wheel group)

I'm using this tidbit of code to get the users password. This is in a function called getpass.

if [ "${EFFUSR}" = "root" ] ; then
 ${SU} - ${REALUSR} -c "${SUDO} -k ; ${SUDO} -v -p 'To verify user, enter password for %u: '"
RETURN=$?
else
 ${SUDO} -k ; ${SUDO} -v -p 'To verify user, enter password for %u: '
RETURN=$?
fi

It's my assumption that when I run this, I am updating the timestamp for the user. But subsequent calls to $SUDO in the script re-prompt me for the password. I can't seem to figure out why, but I'm thinking it's because of something to do with the shell calling different functions within the script.

-Any Ideas?

[EMAIL PROTECTED]:/adm > ./passtool jumbo
To verify user, enter password for admmadis:
User Authorized...
Password:Enter pass phrase for /adm/rsakey.prv:

Attempting to Cleanup & Exit gracefully...
Password:[EMAIL PROTECTED]:/adm >


--
Ryan Madison
Reno, NV 89521

e. [EMAIL PROTECTED]
aim. Alp1n1ste
yim. rhmadiso
_______________________________________________
RLUG mailing list
[email protected]
http://lists.rlug.org/mailman/listinfo/rlug

Reply via email to