Opened 2 years ago

Last modified 2 months ago

#21392 assigned New feature

changepassword option to read from stdin

Reported by: pkasid Owned by: AeroNotix
Component: contrib.auth Version: master
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 (11)

comment:1 Changed 2 years ago by pkasid

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to pkasid
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 2 years ago by claudep

  • Resolution set to duplicate
  • Status changed from assigned to closed

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 2 years ago by pkasid

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 2 years ago by aaugustin

  • Resolution duplicate deleted
  • Status changed from closed to new

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

comment:5 Changed 22 months ago by aaugustin

  • Triage Stage changed from Unreviewed to Accepted

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

comment:6 Changed 20 months 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 20 months ago by AeroNotix

  • Owner changed from pkasid to AeroNotix
  • Status changed from new to assigned

comment:8 Changed 20 months ago by AeroNotix

  • Has patch set
  • Triage Stage changed from Accepted to Ready for checkin

comment:9 Changed 20 months ago by bmispelon

  • Triage Stage changed from Ready for checkin to Accepted

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

comment:10 Changed 16 months ago by timo

  • 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 2 months ago by mokys

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)?

Note: See TracTickets for help on using tickets.
Back to Top