Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Technical Support _ hiding passwords in bash scirpts

Posted by: aristosv Apr 7 2016, 06:21 AM

In Powershell if I want to hide the password in a script, I run this command:

Read-Host -assecurestring | convertfrom-securestring | Out-File C:\tmp\password.txt

I get a popup, enter my password and the text file is created containing a very long string of characters. If I need to use the password in a script I use this:
Get-Content C:\tmp\password.txt | ConvertTo-SecureString

This is convenient because I don't get password prompts when running scripts.

How can I do this on Linux, in a bash script?

Powered by Invision Power Board (
© Invision Power Services (