![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How Do I Hide the Password in a Script | samd | Shell Programming and Scripting | 6 | 11-22-2006 02:38 AM |
| Want to hide password | arpitk | Shell Programming and Scripting | 1 | 09-29-2006 05:42 AM |
| Hide oracle password on unix process list | acheepi | Shell Programming and Scripting | 3 | 10-06-2005 06:25 PM |
| How to hide password on Linux? | nir_s | Shell Programming and Scripting | 2 | 02-09-2005 09:24 AM |
| hide password typing | ivancheung | High Level Programming | 2 | 09-30-2004 10:05 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hide Password
Hi,
I am trying to write a shell script to call ftp program to send files to windows shared drive. I don't want my user to directly deal with ftp program, so I use shell as an interface to allow them to give userID and password. Is there anyway that I can hide the password when user input within shell program just like when we log into Unix? Any help would be appreiciated! |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
#! /usr/bin/ksh
print -n "Enter password - " stty -echo read PASSWORD stty echo Then just use $PASSWORD where you need it. |
|
#3
|
|||
|
|||
|
Quote:
echo "Enter password" read -s PASSWORD |
|
#4
|
||||
|
||||
|
stty -echo
Thanks for all the help!!
|
|
#5
|
|||
|
|||
|
You can type
echo Please enter the password stty -echo read $passwd stty echo also you can put *** instead of password on console |
|||
| Google The UNIX and Linux Forums |