Can I change a user password in Linux from the command line with no interactivity?

Posted by Paul Hoffman on Server Fault See other posts from Server Fault or by Paul Hoffman
Published on 2011-11-30T16:43:30Z Indexed on 2011/11/30 17:58 UTC
Read the original article Hit count: 142

Filed under:
|
|

I have a specific use case where I would really like to be able to change a user's password with a single command with no interactivity. This is being done in a safe fashion (over SSH, and on a system with only one user able to be logged in), so it's fine to expose the new password (and even the old one, if necessary) on the command line. FWIW, it's a Ubuntu system.

I just want to avoid having to add something Expect-like to this system for just this one task.

© Server Fault or respective owner

Related posts about ubuntu

Related posts about command-line