We have some bash commands executes through command line
Sample Bash Command: ksh Script.ksh Filename filepath userid host password
In the command line we need to pass the password but while its been executed its displaying password. Is there any way we can modify the bash command and in place "password display as **** .
Sample: ksh Script.ksh Employee.txt /home/opt/ empuser 10.20.30.99 abc@123
Can we modify the above bash command to
Sample: ksh Script.ksh Employee.txt /home/opt/ empuser 10.20.30.99 ********
and read the value inside the script ??
Script Content:
var1 = $1
var2 = $2
var3 = $3
varpassword = $4
..... reading password and running sftp command
ps -f
– Ljm Dullaart Mar 27 '23 at 10:02ps
output and in your shell history. Instead have your script read the password from stdin as the first thing it does, see https://unix.stackexchange.com/a/439575/133219 and pay attention to the comment under it at https://unix.stackexchange.com/questions/439497/is-there-a-way-to-pass-sensitive-data-in-bash-using-a-prompt-for-any-command#comment796004_439575. – Ed Morton Mar 27 '23 at 12:06