Someone getting the password from your terminal is the least of your problems.
The bigger problem is that using the proxy via a non-encrypted protocol over the network, your login and password can be easily sniffed. BASIC HTTP password authentication encoding is too weak and is deencoded on the fly.
An immediate improvement is tunneling the proxy requests over SSH, using autossh
to be always logged in the proxy server.
Over time, the requests to the proxy service should be made over TLS if possible.
As for the terminal, I always have a lock icon on it, and when I have to leave my desk I click the lock icon.
Back to protecting the password on your disk:
protect the password in an encrypted file, with OpenSSL for instance.
Write a login script that fills your http_proxy variable at login time asking you for a password. If you are using Gnome and are able to get the password from Gnome keyring to fill http_proxy is other interesting solution.
echo $http_proxy
. And any script or program you run has access to that environment variable. A small security hole in any software you run will leak your password. At least I'd limit the setting to the startup script of applications like the web browser that really need it./proc/x/environ
on many systems, so if you're concerned about protecting against them then you're out of luck.