This command is a bit Linux specific, as --stdin doesn't exist for passwd on many Unix machines. Further, useradd is high level in most distributions and Unix derivatives except for the Debian family of distros, where adduser would be more appropriate. The last bit, with chage, will force the user to change their password on new login.
better with accounts on ldap Show Sample Output
I use zenity because it's a rewrite of gdialog and also replaces gmessage and has more useful options. Using --text-info allows you to select and copy the text to your clipboard. To see a file in a list dialog: cat /etc/passwd | zenity --width 800 --height 600 --list --column Entries If you don't have zenity, you'll have to download it via apt-get install zenity, etc.
Used to change a password via a winscp faux shell
Alternately for those without getent or only want to work on local users it's even easier:
cut -d: -f1 /etc/passwd|xargs -n1 passwd -e
Note that not all implementations of passwd support -e. On RH it would be passwd -x0 (?) and on Solaris it would be passwd -f.
This assumes that te original's 'passwd -e' forces a user to change password; it doesn't in the versions I have.
If your contact information was entered when your user account was created (it gets added to /etc/passwd) then this gets that info and creates a QR code for you automatically
Doesn't require finger and should work whatever the underlying auth mechanism is Show Sample Output
Worked well on ubuntu
-d, --delete Delete a user?s password (make it empty). This is a quick way to disable a password for an account. It will set the named account passwordless.
change user password one liner
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: