¿Cómo generar una contraseña compatible con / etc / shadow para Ubuntu 10.04?


10

¿Cómo se generan las contraseñas que usa Ubuntu 10.04? Sé que usan SHA 512 como algoritmo de hashing, pero creo que se ha hecho algún tipo de salazón. Necesito generar esa contraseña yo mismo. ¿Cómo puedo hacer eso? ¿Hay una herramienta de línea de comando para eso?

Respuestas:


14

Debería ser trivial hackear un script rápido de python / perl / lo que sea y llamar a la función crypt (3) .

The glibc2 version of this function supports additional encryption algorithms.

If salt is a character string starting with the characters "$id$" followed by
a string terminated by "$":

      $id$salt$encrypted

then instead of using the DES machine, id identifies the encryption method
used and this then determines how the rest of the password string is
interpreted.  The following values of id are supported:

      ID  | Method
      ---------------------------------------------------------
      1   | MD5
      2a  | Blowfish (not in mainline glibc; added in some
          | Linux distributions)
      5   | SHA-256 (since glibc 2.7)
      6   | SHA-512 (since glibc 2.7)

So $5$salt$encrypted is an SHA-256 encoded password and $6$salt$encrypted is
an SHA-512 encoded one.

"salt" stands for the up to 16 characters following "$id$" in the salt.  The
encrypted part of the password string is the actual computed password.  The
size of this string is fixed:

MD5     | 22 characters
SHA-256 | 43 characters
SHA-512 | 86 characters

The characters in "salt" and "encrypted" are drawn from the set [a-zA-Z0-9./].
In the MD5 and SHA implementations the entire key is significant (instead of
only the first 8 bytes in DES).

Todavía puede usar contraseñas md5 en el archivo shadow en sistemas que tienen por defecto sha-512 u otra cosa. El comando como la herramienta makepasswd se puede usar para generar un hash MD5.

Puede usar el mkpasswd que extrañamente es parte del paquete whois en Debian / Ubuntu. mkpasswd -m sha-512. (Encontrado aquí )

Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.