pam_panic 是一个 PAM 模块,用于保护敏感数据并为紧急情况提供紧急功能。
您可以选择以下两个选项之一:
有两种可充当密钥的可移动介质:auth 密钥和紧急密钥。 auth 密钥将让您进入密码提示,而紧急密钥(如果提供)将安全地擦除 LUKS 标头,使数据不可读。
您可以设置两个密码:密钥密码和紧急密码。密钥密码将让您进入原始密码提示,而紧急密码(如果提供)将安全地擦除 LUKS 标头,使数据不可读。
有
新版本有 PPA 更新。
要使用 PPA 安装软件包:
sudo add-apt-repository ppa:bandie/pampanic
sudo apt-get update
sudo apt-get install pampanic
您将需要 GCC 或类似文件,以及 PAM 标头。某些发行版将 PAM 标头打包为libpam0g-dev
。您还需要dialog
、 autoconf
和gettext
。有些还需要autopoint
。
要编译并安装它,请在项目的根目录中执行以下操作:
$ [ ! -e ./configure ] && autoreconf -i
$ ./configure
$ make
$ sudo make install
注意: reboot
、 poweroff
和cryptsetup
命令的路径在编译时传递给模块。
如果您想使用可移动媒体,则需要两个 GPT 格式的可移动存储设备,并且所述设备必须至少有一个分区。下面是一个fdisk
会话示例,展示了如何实现这一点:
$ sudo fdisk /dev/sdc
Welcome to fdisk (util-linux 2.31.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): g
Created a new GPT disklabel (GUID: AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA).
Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-15661022, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-15661022, default 15661022):
Created a new partition 1 of type 'Linux filesystem' and of size 7.5 GiB.
Command (m for help): w
您将在/dev/disk/by-partuuid/
中找到分区的 UUID。您可以在您最喜欢的 shell 中输入ls -l /dev/disk/by-partuuid/
来找出哪个设备。
更简单的方法是运行pam_panic_config
。
困难的方法:
要配置模块,请将以下内容添加到相应的 PAM 配置文件中:(有关这些文件的详细信息,请参阅pam.conf(5)
)
auth requisite /usr/local/lib/security/pam_panic.so auth=<UUID> reject=<UUID> reboot serious=<UUID>
account requisite /usr/local/lib/security/pam_panic.so
auth requisite /usr/local/lib/security/pam_panic.so password reboot serious=<UUID>
account requisite /usr/local/lib/security/pam_panic.so
要设置密码,请在您首选的 shell 中以 root 身份运行pam_panic_pw
。
有关详细信息,请参阅man 8 pam_panic
和man 1 pam_panic_pw
。
如果您想确保在重新启动/关闭时清除所有信息,您可能需要将选项page_poison=on
和slub_debug=P
添加到内核参数中。对于 GRUB2,您只需将其附加到/etc/default/grub
中的GRUB_CMDLINE_LINUX
条目,然后重建 GRUB2 配置: grub-mkconfig -o /boot/grub/grub.cfg