O'Reilly logo

Linux in a Nutshell, Fourth Edition by Aaron Weber, Stephen Figgins, Ellen Siever

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

mkpasswd

Synopsis

                  mkpasswd [options] [user]

Generate a new password for the specified user. The passwords produced are hard to guess and therefore more secure than passwords made up by actual people. Some operating systems distribute a different mkpasswd command, which regenerates the user password database; if your system has this version, check the manpage for instructions on how to use it.

If you do not specify a user, mkpasswd will display a new password. If you do specify a user, make sure that you have permission to set their password; this will usually mean being root.

Options

-l n

Generate a password that is n characters long. The default is 9.

-d n

Generate a password with at least n digits in it. The default is 2.

-c n

Generate a password with at least n lowercase letters in it. The default is 2.

-C n

Set the minimum number of uppercase letters in the password. The default is 2.

-s n

Generate a password with at least n special characters in it. The default is 1.

-p programname

Set the program used to actually set the password. If you do not choose one, the system will try to use yppasswd, or, if that is not installed, passwd.

-2

Choose characters in the password so that, on a QWERTY-style keyboard, they alternate between left and right hand keys. This makes it harder for someone to guess what the password is if they watch you type it, but can make automated attacks easier.

-v

Verbose mode; display the interaction between mkpasswd and the system as it sets the password. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required