|
Home > Archive > Unix Programming > November 2006 > Need to Send a Command a Password in a Script
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Need to Send a Command a Password in a Script
|
|
| j_philipps@hotmail.com 2006-11-21, 7:21 pm |
| I am executing a command in a .ksh script that prompts for a password
when that command is run on the command line.
Is there a way that I can send the password of the userid that is
executing the script to the command and, at the same time, make that
password hidden within the script. The line of code would be like this:
> become abc <----- I need to send this command the userid's
password in answer to the
command's prompt.
Thank you!
JP
| |
| Bill Marcum 2006-11-26, 1:28 am |
| On 21 Nov 2006 16:00:38 -0800, j_philipps@hotmail.com
<j_philipps@hotmail.com> wrote:
> I am executing a command in a .ksh script that prompts for a password
> when that command is run on the command line.
>
> Is there a way that I can send the password of the userid that is
> executing the script to the command and, at the same time, make that
> password hidden within the script. The line of code would be like this:
>
> password in answer to the
> command's prompt.
>
> Thank you!
>
Learn to configure sudo so you won't need a password to execute this
command as that user.
--
I just forgot my whole philosophy of life!!!
|
|
|
|
|