Hi, You could use STDIN to pipe the value of $var into cryptsetup, if that fits your needs. See man page on password processing to make sure you don't hit any surprises. Regards -Sven On Fri, December 26, 2014 03:47, Jian-Ming Zheng wrote: > Hi, > > I want to write a script to add a new key to LUKS device /dev/sda2. As > I know, I can set the new key in a key file (for example, > new-key-file) and use the key file in the option. For example, > > $ cryptsetup luksAddKey /dev/sda2 new-key-file > > Can I add a new key from a variable defined in my script (for example, > $newkey) instead of using a key file? > > Thanks > _______________________________________________ > dm-crypt mailing list > dm-crypt@xxxxxxxx > http://www.saout.de/mailman/listinfo/dm-crypt > _______________________________________________ dm-crypt mailing list dm-crypt@xxxxxxxx http://www.saout.de/mailman/listinfo/dm-crypt