Operating System - HP-UX
1751894 Members
5186 Online
108783 Solutions
New Discussion юеВ

Re: Hide the typing password in shell script

 
sathish12345
New Member

Hide the typing password in shell script

Hi,

 

In my shell script, I am connecting to oracle database and executing some queries. For that i am prompting the password to the user. But I want to hide the typing content(password) due to security reason. 

 

In bash , I can pass like "read -s password". But in my servers, bash kernal is not installed. Basic kernal only is there. How to solve this issue??

 

 

Please help me

2 REPLIES 2

Re: Hide the typing password in shell script

Surprised google didn't find you this:

 

echo "enter password: \c"

stty -echo

read pw

stty echo

 

And then the passowrd is stored in ${pw}


I am an HPE Employee
Accept or Kudo
Steven Schweda
Honored Contributor

Re: Hide the typing password in shell script