「cryptsetup luksFormat」がパスワードの入力を求められないのはなぜですか?

「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.

ベストアンサー1

あなたは構文を混同しましたluksFormatそしてluksOpen

luksFormatデバイスが開かないため、デバイス名はマップされません。したがって、1つを渡そうとすると、それをキーファイルのファイル名として解釈して開こうとします(おそらく失敗する可能性があります)。

各コマンドは使用時に次のようになります。

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

おすすめ記事