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

system command requiring administrative privileges #214

Closed
dusual opened this issue Dec 17, 2010 · 2 comments
Closed

system command requiring administrative privileges #214

dusual opened this issue Dec 17, 2010 · 2 comments
Milestone

Comments

@dusual
Copy link

dusual commented Dec 17, 2010

For system command that require administrative privileges there is no mechanism to hide the password.


!sudo apt-get install grin
[sudo] password for amit: abcdef

The problem was encountered on ubuntu 10.04 with ipython version 0.14+

@takluyver
Copy link
Member

Within Python, there's a getpass module for this sort of thing. But we have to send user input on to a running process, and I don't think there's a good general way to discover when the process wouldn't echo stdin. As a simple workaround, we could make a sudo magic function which would use getpass, then run the process and silently feed it that password.

@bfroehle
Copy link
Contributor

Two points:

  1. I cannot reproduce this on Ubuntu 12.04.
  2. There are several potential workarounds, including:
  • Hit ctrl-z to drop back to your shell and run sudo there.
  • Run !bash to get a shell prompt, then run sudo.

For these reasons, I'm going to mark the issue as closed.

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

3 participants