tags:

views:

419

answers:

2

So I'm working to hide the password from the ps -aux list, or w list in linux.

I'm using rlwrap and sqlplus, connecting thusly:

rlwrap sqlplus user/pass@connect_identifier

And it shows my pass in plaintext in the who list.

Anyone know how I can make it so that it does not show the password?

+2  A: 

(Answer shamelessly stolen from here)

You can invoke sqlplus with something like:

rlwrap sqlplus internal @/path/to/script

where /path/to/script contains connect user/pass@connect_identifier ; and has permissions such that a normal user can't access it.

Dave Rigby
that did it, thanks!
Ray
+1  A: 

It is best to prompt for a password, read it from stdin or a file, or get it from an environment variable. However if you really want to change what is shown by ps you can use a function commonly called setproctitle(). On some BSD systems this is in the C library, but there are various other implementations. Of course, if you do this then there is still a brief period where another user could see the original arguments before you change them.

mark4o