Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'How to Obscure Command Line Passwords' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How to Obscure Command Line Passwords
Authored by: nxg on Jul 06, '10 08:13:31AM

There are two _much_ simpler ways of doing this.

First: If you start a command with a space, it's not entered into the scroll-back history, or the shell history. So that problem disappears

Second: If you want to get a password into an environment variable (nice idea -- I wouldn't have thought of that), then you can copy it into the clipboard (from Keychain Access or wherever it is you've got it noted down), and then

% pbpaste | read MY_PASSWORD_VARIABLE
% echo $MY_PASSWORD_VARIABLE
<OOOOHH, secret>
%



[ Reply to This | # ]
How to Obscure Command Line Passwords
Authored by: SOX on Jul 06, '10 03:05:48PM

<i>First: If you start a command with a space, it's not entered into the scroll-back history, or the shell history. So that problem disappears</i>

??? this is not true on my computer.
% history
196 export PASSWORD=foberry
197 history

The code is just showing a possible implementation of the general idea that you can load a password by indirection of a script. Any way is fine, the point of doing it with perl is that this versatile language allows you do more complicated things if you need to.



[ Reply to This | # ]
How to Obscure Command Line Passwords
Authored by: fds on Jul 06, '10 03:46:52PM

It's an option. Your HISTCONTROL environment variable has to contain ignorespace.

For example,
export HISTCONTROL=erasedups:ignorespace



[ Reply to This | # ]