doc: set LC_CTYPE=C; fixes ef81d164 on MacOS

This commit is contained in:
pedro martelletto
2019-03-06 08:25:30 +01:00
parent 33a10a5adb
commit 9a72ec1ba1
+11 -11
View File
@@ -37,30 +37,30 @@ history, this can be avoided by leaving the argument out all-together and the
software will ask for key/pin to be input. For the management key option (-k) software will ask for key/pin to be input. For the management key option (-k)
this is achieved by leaving out the value but will specifying -k. this is achieved by leaving out the value but will specifying -k.
$ key=`dd if=/dev/urandom 2>/dev/null | tr -d '[:lower:]' | tr -cd '[:xdigit:]' | fold -w48 | head -1` $ key=$(export LC_CTYPE=C; dd if=/dev/urandom 2>/dev/null | tr -d '[:lower:]' | tr -cd '[:xdigit:]' | fold -w48 | head -1)
$ echo $key $ echo ${key}
$ yubico-piv-tool -aset-mgm-key -n$key $ yubico-piv-tool -aset-mgm-key -n${key}
The PIN and PUK should be changed as well. The PIN and PUK should be changed as well.
$ pin=`dd if=/dev/urandom 2>/dev/null | tr -cd '[:digit:]' | fold -w6 | head -1` $ pin=$(export LC_CTYPE=C; dd if=/dev/urandom 2>/dev/null | tr -cd '[:digit:]' | fold -w6 | head -1)
$ echo $pin $ echo ${pin}
$ puk=`dd if=/dev/urandom 2>/dev/null | tr -cd '[:digit:]' | fold -w8 | head -1` $ puk=$(export LC_CTYPE=C; dd if=/dev/urandom 2>/dev/null | tr -cd '[:digit:]' | fold -w8 | head -1)
$ echo $puk $ echo ${puk}
$ yubico-piv-tool -achange-pin -P123456 -N$pin $ yubico-piv-tool -achange-pin -P123456 -N${pin}
$ yubico-piv-tool -achange-puk -P12345678 -N$puk $ yubico-piv-tool -achange-puk -P12345678 -N${puk}
=== Other useful commands === Other useful commands
To generate a new private key: To generate a new private key:
$ yubico-piv-tool -k$key -agenerate -s9c $ yubico-piv-tool -k${key} -agenerate -s9c
To reset PIN/PUK retry counter AND codes (default pin 123456 puk To reset PIN/PUK retry counter AND codes (default pin 123456 puk
12345678): 12345678):
$ yubico-piv-tool -k$key -averify -P$pin -apin-retries --pin-retries=3 --puk-retries=3 $ yubico-piv-tool -k${key} -averify -P${pin} -apin-retries --pin-retries=3 --puk-retries=3
To reset the application (PIN/PUK need to be blocked hence trying a couple To reset the application (PIN/PUK need to be blocked hence trying a couple
of times -- you need to modify this if you have changed the default of times -- you need to modify this if you have changed the default