Re: OS X: Confirming Administrators PassWord
Re: OS X: Confirming Administrators PassWord
- Subject: Re: OS X: Confirming Administrators PassWord
- From: Jason Bourque <email@hidden>
- Date: Thu, 23 May 2002 11:29:05 -0400
After looking at the Man Pages, I think the following will do it. Let me
know if I am off base.
Thanks,
Jason Bourque
Co-Director Boston AppleScript Users Group
Set lSudoPassWord to "HardPassWord"
do shell script "logname"
set lLoginName to result
-- The -k (kill) option to sudo invalidates the user's timestamp.
do shell script "sudo -k"
try
-- The -v (validate) option, sudo will update the user's timestamp.
-- This extends the sudo timeout for another 5 minutes (or whatever
the timeout is set to in sudoers) but does not run a command.
-- The -u (user) option causes sudo to run the specified command as
a user other than root.
do shell script "sudo -v -u " & lLoginName password lSudoPassWord
with administrator privileges
set lValidPassWord to true
on error lErrMsg
tell application (path to frontmost application as text)
display dialog "Administrators PassWord is invalid." buttons
{"Ok"} default button 1 giving up after (60 * minutes)
end tell
set lValidPassWord to false
end try
return lValidPassWord
On 5/22/02 8:34 PM, "Jason Bourque" <email@hidden> wrote:
>
Is there a shell command that will check a given password?
>
>
FYI, I want to check it and store it in a script for later use in shell
>
commands.
>
>
>
>
>
Thanks,
>
>
Jason Bourque
>
Co-Director Boston AppleScript Users Group
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.