Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Commands with passwords as options



On 1 February 2011 23:40, Benjamin R. Haskell <zsh@xxxxxxxxxx> wrote:
> On Tue, 1 Feb 2011, Julien Nicoulaud wrote:
>
>> OK, but at least it is hidden from the shell "UI". Take it as
>> "man-looking-over-your shoulder" protection :-) For example you show
>> something to  someone, you do a backward history search and a command with a
>> clear text password you forgot to exclude from history pops out...
>
> In general, just avoid ever using such options.  But, if you get lazy, two
> ways around it that I use:
>
> # method 1, use a var:
> $ read DBPASSWORD
> *password*here*
> $ <ctrl-l> to clear screen

You can use read -s here and the password will not be echoed to the
screen as you type it. For cat you can use "STTY=-echo cat"

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author