commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Doesn't require finger and should work whatever the underlying auth mechanism is
Used to change a password via a winscp faux shell
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
better with accounts on ldap
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.
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.
This assumes that te original's 'passwd -e' forces a user to change password; it doesn't in the versions I have.
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 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.