Cryptsetup
為什麼“cryptsetup luksFormat”不提示輸入密碼?
我希望
cryptsetup
提示我輸入密碼,但它只是在嘗試打開密鑰文件但未能成功:sudo cryptsetup luksFormat test.img cryptsetup-test WARNING! ======== This will overwrite data on test.img irrevocably. Are you sure? (Type uppercase yes): YES Failed to open key file.
您混淆了
luksFormat
and的語法luksOpen
。
luksFormat
不打開設備,因此不採用設備名稱來映射到。因此,如果您嘗試傳遞一個,它會將其解釋為密鑰文件的文件名並嘗試(並且可能會失敗)打開它。這是一個例子
luksFormat
:sudo cryptsetup luksFormat test.img WARNING! ======== This will overwrite data on test.img irrevocably. Are you sure? (Type uppercase yes): YES Enter passphrase: Verify passphrase:
還有一個例子
luksOpen
:sudo cryptsetup luksOpen test.img cryptsetup-test Enter passphrase for test.img