Antes de empezar
Debe asumir el rol root. Para obtener más información, consulte Uso de sus derechos administrativos asignados de Protección de los usuarios y los procesos en Oracle Solaris 11.2 .
Este comando agrega una nueva clave maestra generada aleatoriamente. La opción –s necesita que la nueva clave maestra se almacene en el archivo keytab predeterminado.
# kdb5_util add_mkey -s Creating new master key for master key principal 'K/M@EXAMPLE.COM' You will be prompted for a new database Master Password. It is important that you NOT FORGET this password. Enter KDC database master key:/** Type strong password **/ Re-enter KDC database master key to verify: xxxxxxxx
# kdb5_util list_mkeys Master keys for Principal: K/M@EXAMPLE.COM KNVO: 2, Enctype: AES-256 CTS mode with 96-bit SHA-1 HMAC, No activate time set KNVO: 1, Enctype: AES-128 CTS mode with 96-bit SHA-1 HMAC, Active on: Fri Dec 31 18:00:00 CST 2011 *
El asterisco en esta salida identifica la clave maestra actualmente activa.
# date Fri Jul 11 17:57:00 CDT 2014 # kdb5_util use_mkey 2 'now+2days' # kdb5_util list_mkeys Master keys for Principal: K/M@EXAMPLE.COM KNVO: 2, Enctype: AES-256 CTS mode with 96-bit SHA-1 HMAC, Active on: Sun Jul 13 17:57:15 CDT 2014 KNVO: 1, Enctype: AES-128 CTS mode with 96-bit SHA-1 HMAC, Active on: Fri Dec 31 18:00:00 CST 2011 *
En este ejemplo, se define la fecha a dos días antes para darle tiempo a la nueva clave maestra a que se propague a todos los KDC. Ajuste la fecha de manera adecuada para su entorno.
# kadmin.local -q 'getprinc tamiko' |egrep 'Principal|MKey' Authenticating as principal root/admin@EXAMPLE.COM with password. Principal: tamiko@EXAMPLE.COM MKey: vno 2
En este ejemplo, MKey: vno 2 indica que la clave secreta del principal está protegida por la clave maestra creada recientemente, 2.
Si agregar un argumento de patrón al final del comando, los principales que coincidan con el patrón se actualizarán. Agregue la opción –n a esta sintaxis de comando para identificar qué principales se actualizarán.
# kdb5_util update_princ_encryption -f -v Principals whose keys WOULD BE re-encrypted to master key vno 2: updating: host/kdc1.example.com@EXAMPLE.COM skipping: tamiko@EXAMPLE.COM updating: kadmin/changepw@EXAMPLE.COM updating: kadmin/history@EXAMPLE.COM updating: kdc/admin@EXAMPLE.COM updating: host/kdc2.example.com@EXAMPLE.COM 6 principals processed: 5 updated, 1 already current
Después de que una clave maestra ya no se utiliza para proteger ninguna clave secreta de principal, se puede depurar del principal de clave maestra. Este comando no depura la clave si la clave aún está siendo utilizada por algún principal. Agregue la opción –n a este comando para verificar que la clave maestra correcta se depurará.
# kdb5_util purge_mkeys -f -v Purging the follwing master key(s) from K/M@EXAMPLE.COM: KNVO: 1 1 key(s) purged.
# kdb5_util list_mkeys Master keys for Principal: K/M@EXAMPLE.COM KNVO: 2, Enctype: AES-256 CTS mode with 96-bit SHA-1 HMAC, Active on: Sun Jul 13 17:57:15 CDT 2014 *
# kdb5_util stash Using existing stashed keys to update stash file.
# klist -kt /var/krb5/.k5.EXAMPLE.COM Keytab name: FILE:.k5.EXAMPLE.COM KVNO Timestamp Principal ---- ---------------- --------------------------------------------------------- 2 05/11/2014 18:03 K/M@EXAMPLE.COM