---
name: "mkpasswd"
section: "1"
platform: "linux"
package: "whois"
version: "5.6.6-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/mkpasswd"
---

# mkpasswd(1)

Overfeatured front end to crypt(3)

## NAME

mkpasswd - Overfeatured front end to [crypt(3)](/crypt/3.md)

## SYNOPSIS

**mkpasswd** *PASSWORD* \[*SALT*\]

## DESCRIPTION

**mkpasswd** encrypts the given password with the [**crypt**(3)](/crypt/3.md) libc function, using the given salt.

## OPTIONS

- **-S** STRING, **--salt=***STRING*

  Use the *STRING* as salt. If it begins with *$* then it will be passed straight to [**crypt**(3)](/crypt/3.md) without any checks.

- **-R** NUMBER, **--rounds=***NUMBER*

  Use *NUMBER* rounds. This argument is ignored if the method chosen does not support variable rounds. For the OpenBSD Blowfish method this is the logarithm of the number of rounds. The behavior is undefined if this option is used without *--method*.

- **-m** TYPE, **--method=***TYPE*

  Compute the password using the *TYPE* method. If *TYPE* is *help* then the list of available methods is printed. If *TYPE* begins and end with *$* characters then the string is passed to [**crypt\_gensalt**(3)](/crypt_gensalt/3.md) as-is.

- **-5**

  Like *--method=md5crypt*.

- **-P** *NUM,* **--password-fd=***NUM*

  Read the password from file descriptor *NUM* instead of using [**getpass**(3)](/getpass/3.md). If the file descriptor is not connected to a tty then no other text than the hashed password is printed on stdout.

- **-s**, **--stdin**

  Like *--password-fd=0*.

## ENVIRONMENT

- MKPASSWD\_OPTIONS

  A list of options which will be evaluated before the ones specified on the command line.

## BUGS

If the *--stdin* option is used then passwords containing some control characters may not be read correctly.

This program suffers of a bad case of featuritis.

## SEE ALSO

[**passwd**(1)](/passwd/1.md), [**passwd**(5)](/passwd/5.md), [**crypt**(3)](/crypt/3.md), [**crypt**(5)](/crypt/5.md), [**crypt\_gensalt**(3)](/crypt_gensalt/3.md), [**getpass**(3)](/getpass/3.md).

## AUTHOR

**mkpasswd** and this man page were written by Marco d'Itri \<*md@linux.it*\> and are licensed under the terms of the GNU General Public License, version 2 or later.
