Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to make user input invisible as a 'sudo' password input?

I'm using raw_input() to receive password from user in interactive mode, but I want to make input symbols invisible for security reasons, as it is when you're typing your password using sudo or connecting to a database. How I should do it?

like image 790
Enchantner Avatar asked Jan 20 '10 14:01

Enchantner


1 Answers

You need the getpass module.

from getpass import getpass
password = getpass()
like image 52
jkp Avatar answered Oct 11 '22 06:10

jkp