From: "Michael Kjörling" <michael@kjorling.se>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] Unattended generation/opening.
Date: Sun, 9 Aug 2020 07:46:53 +0000 [thread overview]
Message-ID: <8ef2383c-6319-4be3-8cbf-1ef2724131a3@localhost> (raw)
In-Reply-To: <173d0f6cd51.fb4f7ba8559099.2318785520831138201@xoxy.net>
On 8 Aug 2020 19:05 -0700, from saout.boxy@xoxy.net (Diagon):
> Could someone let me know what I'm doing wrong here? I'm trying to do this in a script, but it doesn't work on the command line, either:
>
> $ echo "lukssecpwd" | sudo cryptsetup -c twofish-xts-plain64 -s 512 luksFormat /dev/loop5 -
> $ echo "lukssecpwd" | sudo cryptsetup open /dev/loop5 crypt.secret
> No key available with this passphrase.
Norepro on up-to-date Debian Buster with cryptsetup 2.1.0 (package
version 2:2.1.0-5+deb10u2) with kernel 4.19.0-10-amd64 (package
version 4.19.132-1) reporting build date 2020-07-24.
# truncate -s 100M /root/lukstest
# losetup -f /root/lukstest
# losetup -l
NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE DIO LOG-SEC
/dev/loop0 0 0 0 0 /root/lukstest 0 512
# echo "lukssecpwd" | cryptsetup luksFormat /dev/loop0
# echo "lukssecpwd" | cryptsetup open /dev/loop0 lukstest.loop0
# ls -l /dev/mapper/lukstest.loop0
lrwxrwxrwx 1 root root 7 Aug 9 09:37 /dev/mapper/lukstest.loop0 -> ../dm-9
# cryptsetup close lukstest.loop0
# ls -l /dev/mapper/lukstest.loop0
ls: cannot access '/dev/mapper/lukstest.loop0': No such file or directory
#
Seems to work just fine all the way through.
Using echo to pipe the passphrase into luksFormat and then entering it
manually into the later cryptsetup open invocation also works fine for
me.
That said, maybe adding "--key-file -" and dropping the "-" from the
luksFormat command might help? If not, please try it again with
--debug and show us the output of that.
--
Michael Kjörling • https://michael.kjorling.se • michael@kjorling.se
“Remember when, on the Internet, nobody cared that you were a dog?”
next prev parent reply other threads:[~2020-08-09 7:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-09 2:05 [dm-crypt] Unattended generation/opening Diagon
2020-08-09 7:46 ` Michael Kjörling [this message]
2020-08-09 7:51 ` Milan Broz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8ef2383c-6319-4be3-8cbf-1ef2724131a3@localhost \
--to=michael@kjorling.se \
--cc=dm-crypt@saout.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox