Hiding a password from process status
Hi All,
Not sure if this is actually possible, or if there is a more suitable method... I set a password for the rar command (rar a folder.rar -hpThisIsThePassword.....) However if I search for this process, the password is displayed: Code:
ps -ef | grep rar Is there another method I can use to prevent the password from showing? Thanks in advanced. |
Maybe you could store the rar password in a file somewhere (assuming only your user permissions have access to it) and then run the command like so:
Code:
$ rar a folder.rar -hp`cat somefile` |
Quote:
Code:
read -e -s -p "pass?" mypasswd Next, run your rar command like so Code:
rar a folder.rar -hp$mypasswd |
I believe coralfang's method is better than mine because the password is store in a file. My method above will hide the password but it requires interaction from you.
If you want to make a strong password for your rar archive and store it in a file, you can run this command Code:
tr -dc [:graph:] < /dev/urandom | head -c 15 | xargs -0 > somefile Next, chmod your file, like so Code:
chmod 600 somefile Now you can run the command that coralfang gave you Code:
rar a folder.rar -hp`cat somefile` |
All times are GMT -5. The time now is 08:50 AM. |