Opened 8 years ago

Last modified 3 years ago

#21392 new New feature

changepassword option to read from stdin

Reported by: Paris Kasidiaris Owned by:
Component: contrib.auth Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


It would be really handy to give the user the ability to change user password by supplying it using the stdin.


  • GUIs can build on top of this feature. Right now an IDE for Python/Django, for example, cannot give the user the ability to add users to his/hers Django project with a GUI, without hacking into the Django core itself.
  • Automation tools can build on top of this feature

I suppose that the reason this feature is not implemented yet is that it is considered a security risk. The fact is that this practice cad be found in several software of the UNIX/Linux core.

  • Some versions of passwd can read new password from stdin (
  • chpasswd gets its input from stdin
  • useradd can even get the encrypted passwords from the command line (this could be considered even more risky since you can see the given password in the process history)

I think since this practice already exists in most (if not in all) UNIX/Linux systems, it's not a security breach to be added to Django as well.

I will start working on this patch myself.

Change History (13)

comment:1 Changed 8 years ago by Paris Kasidiaris

Owner: changed from nobody to Paris Kasidiaris
Status: newassigned

comment:2 Changed 8 years ago by Claude Paroz

Resolution: duplicate
Status: assignedclosed

This was already wontfixed in #18897. I suggest you start a thread on the django-developers mailing list to make your case. Reopen then if you get core dev support.

comment:3 Changed 8 years ago by Paris Kasidiaris

Sorry but this is not a duplicate. I am proposing reading the password from the standard input. Not as a second parameter. The security risks listed at #18897 are not valid for my ticket.

If something can be put on the command line, someone is going to try and use the argument in a script.

No password is put in the command line

If you type the password at the command line, it will be preserved in command history, which means anyone who can get access to your login can find out your password, too.

No password is typed in the command line

Could you please reconsider opening my ticket?

comment:4 Changed 8 years ago by Aymeric Augustin

Resolution: duplicate
Status: closednew

I don't know if it's a good idea but indeed it wasn't discussed in the other ticket.

comment:5 Changed 8 years ago by Aymeric Augustin

Triage Stage: UnreviewedAccepted

I'm going to move this to Accepted, which may trigger the wrath of the security overlords...

comment:6 Changed 8 years ago by AeroNotix

I don't believe this is a security concern at all. The option is to enable reading *from* stdin, not a --this-is-my-new-password-bro switch. Seems reasonable.

comment:7 Changed 8 years ago by AeroNotix

Owner: changed from Paris Kasidiaris to AeroNotix
Status: newassigned

comment:8 Changed 8 years ago by AeroNotix

Has patch: set
Triage Stage: AcceptedReady for checkin

comment:9 Changed 8 years ago by Baptiste Mispelon

Triage Stage: Ready for checkinAccepted

The "ready for checkin" flag is for when someone else has reviewed your patch and deemed it ready.

comment:10 Changed 8 years ago by Tim Graham

Has patch: unset

The ticket has "Has patch" set, but I don't see a patch or a link to a pull request?

comment:11 Changed 6 years ago by Jan Munclinger

What does it mean "read password from stdin" if it is not already possible (the command asks you for a password at least from django 1.2) and if it doesn't mean to put it into a command line (--password my-new-pass)?

comment:12 Changed 3 years ago by James Pic

Implemented in reusable third party CLI :

comment:13 Changed 3 years ago by Sky Christensen

Owner: AeroNotix deleted
Status: assignednew
Note: See TracTickets for help on using tickets.
Back to Top