remote unlocking via ssh: interactive vs passphrase piping
Vincent Lefevre <[email protected]> Mon, 6 Jul 2026 16:11:11 +0200
| Newsgroups | gmane.linux.debian.user |
|---|---|
| Message-ID | <[email protected]> |
About remote unlocking of a LUKS partition,
/usr/share/doc/cryptsetup/README.Debian.gz says
You can then unlock the disk remotely via SSH with
ssh -tF ~/.luks/ssh.conf [email protected] cryptroot-unlock
Or, using a local gpg-encrypted key file:
gpg --decrypt ~/.luks/remote.key.gpg | ssh -TF ~/.luks/ssh.conf [email protected] cryptroot-unlock
In my case, "ssh -t ..." works fine:
X11 forwarding request failed on channel 0
Please unlock disk nvme0n1p3_crypt:
cryptsetup: nvme0n1p3_crypt set up successfully
But if I do
cat file | ssh -T ...
where "file" is a text file just containing the passphrase,
I get an error:
X11 forwarding request failed on channel 0
Please unlock disk nvme0n1p3_crypt
cryptsetup: cryptsetup failed, bad password or options?
What could be the cause?