-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
automatticlly add keyscript to crypttab #52
base: master
Are you sure you want to change the base?
Conversation
@@ -93,4 +93,21 @@ else | |||
if [ "$DBG" = "1" ]; then echo "LUKS key: $R"; fi | |||
fi | |||
|
|||
# add keyscript to /etc/crypttab | |||
|
|||
if [[ -b ${DISK} ]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are several yubikeys connected to a machine I would not like to update the initramfs each time a yubikey is added. So we should use a command line parameter here. Like
-u update initramfs config
eval $( grep ${DISK} /etc/crypttab | awk '{ print $2 }' ) | ||
fi | ||
|
||
if ! grep 'keyscript=/usr/share/yubikey-luks/ykluks-keyscript' /etc/crypttab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use square brackets here, to have a consistent code style.
Also: I think we should only match for "keyscript"; so that we do not add a 2nd keyscript if another keyscript was already configured!
|
||
if ! grep 'keyscript=/usr/share/yubikey-luks/ykluks-keyscript' /etc/crypttab | ||
then | ||
sed -i "/${UUID}/ s/$/,keyscript=\/usr\/share\/yubikey-luks\/ykluks-keyscript/" /etc/crypttab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this breaks for me. I think this is not very robust. Even in another shell (bash), this starts to break.
Automatically add keyscript to crypttab when enrolling if the keyscript is not already set.