Questions tagged [getpass]

Use for questions concerning the Python stdlib module which provides secure and portable password input

Many programs that interact with the user via the terminal need to ask the user for password values without showing what the user types on the screen. The getpass module provides a portable way to handle such password prompts securely.

52 questions
9
votes
3 answers

getpass is not working for spyder (Python)

I'm trying to use getpass to hide the input but it just gives me this error: "Warning: QtConsole does not support password mode, the text you type will be visible." I'm using Spyder. Here is my code: import getpass pswd =…
8
votes
4 answers

How to suppress the display of passwords?

I need to hide password when user run script in console (like this: mysql -p). For input parameters I use argparse, how I can add getpass to password parameter? parser = argparse.ArgumentParser() parser.add_argument('-p', action='store',…
oxana
  • 375
  • 1
  • 3
  • 10
6
votes
1 answer

Rmarkdown password with getPass

I am building an application in RMarkdown that relies upon a user-generated password: library(getPass) pw <- getPass(msg = "Enter the Password, please!") When I run all of the code interactively in the R console, the getPass function pauses the…
DoubleTap
  • 69
  • 1
  • 3
5
votes
2 answers

Making getpass read from shell script

I have python script (3rd party script) calling getpass. I need to use a script to provide the password. Simple piping doesn't work because getpass, according to the doc, reads from /dev/tty. I'm by no means a shell or python expert, so is there a…
sel
  • 483
  • 5
  • 16
4
votes
1 answer

How to add '\n" to a variable value to submit it as an input of remote process via Paramiko

I am working with Paramiko on Linux, I would like to know if I can send a variable to shell. I want to enter to "enable mode" of a Cisco router. But I don't want to hard-code the password in the script. I am using getpass, but when I run the script…
MadChabelo
  • 81
  • 5
3
votes
0 answers

getpass isn't working in jupyter notebook (python 3.6, Ubuntu 18.04)

I recently updated from ubuntu 16.04 to 18.04. getpass was working with jupyter in ubuntu 16.04. However, since the upgrade it has ceased to work. Whenever I enter getpass.getpass in a jupyter notebook, the box will show up where you can enter a…
3
votes
1 answer

Get password silently from clipboard in Python

The standard way to enter a password in Python without echoing it is using getpass.getpass(). However,it doesn't support clipboard input (ctrl-V), which is needed when dealing with complex, highly secure passwords. Has anyone ever come up with a…
mrgou
  • 1,576
  • 2
  • 21
  • 45
2
votes
1 answer

Can't pass password to SSH by getpass

I have code like under: def acces_machine_connnect(): print(namess.secnd_banner) login = input('Login: ') passwd = getpass.getpass('Password:') ssh_proxy = paramiko.SSHClient() …
2
votes
1 answer

trainer.train() in Kaggle: StdinNotImplementedError: getpass was called, but this frontend does not support input requests

When saving a version in Kaggle, I get StdinNotImplementedError: getpass was called, but this frontend does not support input requests whenever I use the Transformers.Trainer class. The general code I use: from transformers import Trainer,…
2
votes
0 answers

How to hide password input with getpass in Python 3 on Visual Studio Code?

The following code snippet: from getpass import getpass username = input("Username: ") password = getpass("Password: ") When run in Visual Studio Code's integrated Python Console produces the following result: Username: User Warning: Password…
Matthias
  • 12,704
  • 13
  • 35
  • 56
2
votes
1 answer

dill.dump_session not working with getpass

I have a Jupyter notebook whose state I want to save using dill.dump_session, however the function throws an error if the notebook uses the getpass module. Is there any way around this issue? I understand the point of not dumping the password, but I…
2
votes
2 answers

How to get all Windows/Linux user and not only current user with python

I know how to get the current user using os or getpass.getuser(), but is there a way to get a list of all user and not only the current one? Read os and getpass documentations but i didn't thing anything.
Arus
  • 21
  • 1
  • 3
2
votes
0 answers

getpass in pytest return OSError: reading from stdin while output is captured

I'm trying to write a test in pytest to pass a password with getpass but I'm getting this error: OSError: reading from stdin while output is captured here is my function: def test_my_password_check(monkeypatch): password = 'pytestpassword' …
virtualdvid
  • 2,323
  • 3
  • 14
  • 32
2
votes
1 answer

How do I hide input WITHOUT getpass (it doesn't work)?

I've been trying to make a simple sign-up/in program and I wanted to hide the password, so I took to the internet. I tried out this thing called getpass, but it didn't work. It just told me it couldn't change the echo in IDLE's shell.(I use IDLE…
2
votes
0 answers

getpass.getpass() hangs on ipython notebook

I am using very simple code on ipython notebook for user to input password. Command hangs after user inputs the password. Here is my code sample - import getpass try: p = getpass.getpass() except Exception as error: print('ERROR',…
1
2 3 4