Pan*_*cho 6 linux encryption redhat
我有一个Red Hat 6.5 Linux实现,它使用LUKS加密系统,并且 - 由于不相关的原因 - 我想在一段时间内"关闭"启动加密检查.它会在某个时候再次打开,所以即使可以完全删除LUKS加密,这也不是我感兴趣的解决方案.
我想要的是在启动时自动提供LUKS密码,这样就不需要手动输入 - 因此即使仍然实际启用,逻辑上也会"关闭"加密.
现在,虽然这对于辅助设备来说很简单,即.通过创建密钥文件,将密钥文件应用于加密设备并修改/ etc/crypttab以引用密钥文件,仍然必须在引导时输入至少一个密码 - 因为,如果主设备是LUKS加密的,那么它首先必须在/ etc/crypttab可访问之前解密.
有一种方法我已经看到删除输入初始密码的要求,即:
除了我不想要一个可移动的未加密设备外,这一切看起来都不错.我只是希望服务器启动,好像它没有加密.
我能看到实现这一目标的唯一方法是用普通的未加密设备替换可移动的未加密设备.在这种情况下,引导过程将读取正常的未加密设备,获取密钥并使用它来解密加密设备...嘿presto加密被禁用.
我能在我的系统上找到的唯一符合正常未加密设备标准的设备是/ dev/sda1 ie./ boot,所以我按照以下步骤3和步骤4执行了上述步骤:
不幸的是,我似乎无法让这个工作.
Red Hat启动并且我没有被要求输入密码(正如预期的那样),但是在启动过程结束时,它失败了"内核恐慌 - 没有同步:尝试杀死init!..."
无论以下哪种使用方式,此行为都是相同的:
所以我的问题如下:
提前感谢您的帮助
经过多次挖掘后,我终于找到了答案(适用于CentOS 6.6和7).特别感谢以下2个资源:
我做的是如下(以root用户身份):
# insert a password into my chosen password file
echo -n "anypassword" > /etc/mypasswdfile
# instruct the LUKS device to take the password from my password file
vi /etc/crypttab and replaced the 3rd parameter "none" with "/etc/mypasswdfile"
# add my password file as a valid key for the luks device
cryptsetup luksAddKey /dev/sda2 /etc/mypasswdfile
# configure dracut to add the following 2 items to the initramfs (so accessible at boot)
echo 'install_items="/etc/mypasswdfile /etc/crypttab"' > /etc/dracut.conf.d/99-mypwfile.conf
# instruct dracut to apply the configuration
dracut -f
# reboot the server
reboot
Run Code Online (Sandbox Code Playgroud)
就是这样.服务器在不请求密码的情况下重新启动.(可以通过cryptsetup命令从LUKS设备删除/添加密钥文件来禁用/启用此功能)