Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c.sudo auto password prompt results in AuthFailure #1906

Open
hyperknot opened this issue Nov 24, 2018 · 5 comments
Open

c.sudo auto password prompt results in AuthFailure #1906

hyperknot opened this issue Nov 24, 2018 · 5 comments

Comments

@hyperknot
Copy link

If I'm using c.sudo's automatic password prompt, it results in AuthFailure.
If I supply the password either using password= or using config= connection override it works.
Something is wrong with the interactive password handling.

client: Python 3.7, macOS 10.13.6
host: Ubuntu 16.04

c = Connection(host='...', user='ubuntu', connect_kwargs={'password': 'x'})

c.run('ls -l') # works
c.sudo('ls -l', password='x') # works
c.sudo('ls -l') # AuthFailure

Traceback:

Traceback (most recent call last):
  File "./prepare_server.py", line 54, in <module>
    c.sudo('ls -l')
  File "<decorator-gen-4>", line 2, in sudo
  File "/usr/local/lib/python3.7/site-packages/fabric/connection.py", line 30, in opens
    return method(self, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/fabric/connection.py", line 716, in sudo
    return self._sudo(self._remote_runner(), command, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/invoke/context.py", line 226, in _sudo
    raise_from(error, None)
  File "<string>", line 2, in raise_from
invoke.exceptions.AuthFailure: The password submitted to prompt '[sudo] password: ' was rejected.
@azam-mamatmurodov
Copy link

azam-mamatmurodov commented May 6, 2020

I have the same error

@limouren
Copy link

limouren commented Jan 10, 2022

Can confirm the sudo password prompt not working too. It pause for a while and raise AuthFailure for me without typing anything. If I tried to type before the exception thrown, I can see clear text on my console.

Host: CentOS 7
Client: macOS 11.6, Python 3.9.7

> pip freeze
bcrypt==3.2.0
cffi==1.15.0
cryptography==36.0.1
fabric==2.6.0
invoke==1.6.0
paramiko==2.9.2
pathlib2==2.3.6
pycparser==2.21
PyNaCl==1.5.0
six==1.16.0

@dshah244
Copy link

Hi everyone,

I was running into AuthFailure due to the latest paramiko v2.9 release and limiting paramiko to v2.8 worked for me.
Could you also confirm this issue once, please?

@limouren
Copy link

Hi @dshah244, still the same for me:

bcrypt==3.2.0
cffi==1.15.0
cryptography==36.0.1
fabric==2.6.0
invoke==1.6.0
paramiko==2.8.0
pathlib2==2.3.6
pycparser==2.21
PyNaCl==1.5.0
six==1.16.0

@davidjmemmett
Copy link
Contributor

Hi,

Could you please provide some additional information to help us reproduce your issue?

  • What version of the Python interpreter are you using? Are you using an alternative interpreter such as PyPy?
  • What operating system are you using both client & server-side?
  • Are you using OpenSSH server or something else?
  • Which version or versions of the software are you using?
  • How can the developers recreate the bug on their end? If possible, include a copy of your code, the command you used to invoke it, and the full output of your run (if applicable.)
    A common tactic is to pare down your code until a simple (but still bug-causing) “base case” remains. Not only can this help you identify problems which aren’t real bugs, but it means the developer can get to fixing the bug faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants