Prompting for password on the command line

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Prompting for password on the command line

Chuck Bearden
Hi all,

Using Jython 2.7b3.

I know that getpass.getpass() is to be avoided because it echoes the
password entered. I tried to use the Java console in the following
way:

    from java.lang import System
    cons = System.console()
    pass = cons.readPassword()

but only one character is read and the program continues.

Is there a correct, secure way to prompt a user for a password from a
program running on the command line?

Thanks,
Chuck

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users