Aquesta ordre la proporciona el paquet:
$ sudo apt-get install whois
Ara escriviu:
$ mkpasswd
Us pregunta una paraula de pas:
Contrasenya:
I us la proporciona xifrada:
5fkX/HnNd3uds
Els salt és un text. Per exemple:
$ mkpasswd -S prova
Si indiqueu el SALT provocarà que la paraula de pas xifrada (el hash) sigui sempre el mateix.
Podeu consultar-los amb:
$ mkpasswd -m help Available methods: des standard 56 bit DES-based crypt(3) md5 MD5 sha-256 SHA-256 sha-512 SHA-512
o
$ mkpasswd --method=help Available methods: des standard 56 bit DES-based crypt(3) md5 MD5 sha-256 SHA-256 sha-512 SHA-512
Cal indicar el tipus i un SALT de 8 bytes (8 caràcters)
NOTA: La paraula de pas utilitzada és 1234
Amb SALT de 8 bytes (2 elevat a la 8 combinacions de SALTs: 256) aleatori:
$ mkpasswd -m md5 Contrasenya: $1$QKSWRtoF$UN6oWKLk4hANsVCad3nE50
NOTA: El que a vosaltres us sortirà serà diferent ja que el més probable és que us surti
NOTA: La paraula de pas utilitzada és 1234
Es pot indicar el SALT:
$ mkpasswd -S n1.1CuXe -5 Contrasenya: $1$n1.1CuXe$mGEkxfY4wY4tNejlUuK9o.
Un altre exemple:
$ mkpasswd -S EFO2qpQU -m md5 Contrasenya: $1$EFO2qpQU$cWAsq3IYsJi8JLr0XwXOt0
Si poseu una mida incorrecta del salt:
$ mkpasswd -S EFO2qpQUs -m md5 Wrong salt length: 9 bytes when 8 expected.
Amb SALT de 8 bytes (2 elevat a la 8 combinacions de SALTs: 256) aleatori:
$ mkpasswd -m sha-512 Contrasenya: $6$0z.2ywJx$JFSrISj3xMyISuTJdqQGFCvMchf70gcbuINnKqoZfYQM9T4Fig8oLw7yGWo2ptnqIo7VzTSBVZubbdNJMt/eA1
o
$ mkpasswd --method=sha-256 Contrasenya: $5$vv1PaRVeFcw9V$6sGdmpC9WTyWmYqTg5iQiGRLvka49TjuOXItdMRCCy5
DES:
$ mkpasswd --method=des Contrasenya: DWcEJagOCZJQg
o
$ mkpasswd Contrasenya: kLHIf48rYCAPY
$ man mkpasswd MKPASSWD(1) Debian GNU/Linux MKPASSWD(1) NAME mkpasswd - Overfeatured front end to crypt(3) SYNOPSIS mkpasswd PASSWORD SALT DESCRIPTION mkpasswd encrypts the given password with the crypt(3) libc function using the given salt. OPTIONS -S, --salt=STRING Use the STRING as salt. It must not contain prefixes such as $1$. -R, --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. -m, --method=TYPE Compute the password using the TYPE method. If TYPE is help then the available methods are printed. -5 Like --method=md5. -P, --password-fd=NUM Read the password from file descriptor NUM instead of using getpass(3). If the file descriptor is not connected to a tty then no other message than the hashed password is printed on stdout. -s, --stdin Like --password-fd=0. ENVIRONMENT MKPASSWD_OPTIONS A list of options which will be evalued before the ones specified on the command line. BUGS If the --stdin option is used, passwords containing some control characters may not be read correctly. This programs suffers of a bad case of featuritis. SEE ALSO passwd(1), passwd(5), crypt(3), getpass(3) AUTHOR mkpasswd and this man page were written by Marco d'Itri <[email protected]> and are licensed under the terms of the GNU General Public License, version 2 or higher. Marco d'Itri 21 March 2008 MKPASSWD(1)