1

It is easy to unlock a LUKS drive over SSH when the drive takes text passwords:

cryptsetup luksOpen /dev/sdb1 mylockeddrive

Then entering the password at prompt.

Is there a way of unlocking these drives when a key file is used, short of copying the key file on the remote system?

nvja
  • 113
  • 5

1 Answers1

6

Send the key via a pipe and tell cryptsetup to read it from standard input.

cat keyfile | ssh remotehost "cryptsetup open --type luks --key-file - /dev/sdb1"
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972