
저는 Arch Linux를 실행 중이고 eCryptFS를 사용하여 암호화된 폴더를 설정하려고 합니다. 나는 Arch's Wiki의 튜토리얼을 따랐습니다.수동 설치, 작동합니다. 부팅 시 이 디렉터리를 자동으로 마운트하려고 하면 문제가 발생합니다.
다음 위치에 이 항목이 있습니다 /etc/fstab
.
/home/henrique/.secret /home/henrique/secret ecryptfs user,rw,nosuid,nodev,relatime,ecryptfs_fnek_sig=5fe512dc3ad6af7e,ecryptfs_sig=e7a764a16f23b1e4,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs 0 0
시작 시 로그에 다음이 표시됩니다.
Jun 08 01:45:15 henrique-pc kernel: Key type trusted registered
Jun 08 01:45:15 henrique-pc kernel: sha256_ssse3: Using AVX optimized SHA-256 implementation
Jun 08 01:45:15 henrique-pc kernel: Key type encrypted registered
Jun 08 01:45:15 henrique-pc mount.ecryptfs[595]: Key module [openssl] does not have a subgraph transition node; attempting to build a linear subgraph from its parameter list
Jun 08 01:45:15 henrique-pc mount.ecryptfs[595]: Key module [openssl] has empty parameter list
Jun 08 01:45:15 henrique-pc mount[594]: Select key type to use for newly created files:
Jun 08 01:45:15 henrique-pc mount[594]: 1) passphrase
Jun 08 01:45:15 henrique-pc mount[594]: 2) openssl
Jun 08 01:45:15 henrique-pc mount[594]: Selection: Error attempting to evaluate mount options: [-5] Input/output error
Jun 08 01:45:15 henrique-pc mount[594]: Check your system logs for details on why this happened.
Jun 08 01:45:15 henrique-pc mount[594]: Try updating your ecryptfs-utils package, and/or
Jun 08 01:45:15 henrique-pc mount[594]: submit a bug report on https://bugs.launchpad.net/ecryptfs
Jun 08 01:45:15 henrique-pc systemd[1]: home-henrique-secret.mount mount process exited, code=exited status=251
Jun 08 01:45:15 henrique-pc systemd[1]: Failed to mount /home/henrique/secret.
-- Subject: Unit home-henrique-secret.mount has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit home-henrique-secret.mount has failed.
--
-- The result is failed.
Jun 08 01:45:15 henrique-pc systemd[1]: Dependency failed for Local File Systems.
-- Subject: Unit local-fs.target has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit local-fs.target has failed.
--
-- The result is dependency.
Jun 08 01:45:15 henrique-pc systemd[1]: Triggering OnFailure= dependencies of local-fs.target.
Jun 08 01:45:15 henrique-pc systemd[1]: Unit home-henrique-secret.mount entered failed state.
Jun 08 01:45:15 henrique-pc systemd[1]: Closed CUPS Printing Service Sockets.
-- Subject: Unit cups.socket has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
/etc/security/pam_mount.conf.xml
튜토리얼에 설명된 대로 구성했습니다 .
<luserconf name=".pam_mount.conf.xml" />
<mntoptions require="" />
<lclmount>mount -i %(VOLUME) "%(before=\"-o\" OPTIONS)"</lclmount>
systemctl status
프로세스가 어떻게 진행되는지는 다음과 같습니다 . -i
마운트 스크립트가 다음 파일에서 선언한 옵션을 사용하지 않는 것이 이상하다고 생각합니다 /etc/security/pam_mount.conf.xml
.
● home-henrique-secret.mount - /home/henrique/secret
Loaded: loaded (/etc/fstab)
Active: failed (Result: exit-code) since Dom 2014-06-08 02:11:24 BRT; 1min 42s ago
Where: /home/henrique/secret
What: /home/henrique/.secret
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
Process: 433 ExecMount=/bin/mount /home/henrique/.secret /home/henrique/secret -t ecryptfs -o user,rw,nosuid,nodev,relatime,ecryptfs_fnek_sig=5fe512dc3ad6af7e,ecryptfs_sig=e7a764a16f23b1e4,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs (code=exited, status=251)[/b]
[b]Jun 08 02:11:24 henrique-pc mount[433]: Select key type to use for newly created files:
Jun 08 02:11:24 henrique-pc mount[433]: 1) passphrase
Jun 08 02:11:24 henrique-pc mount[433]: 2) openssl
Jun 08 02:11:24 henrique-pc mount[433]: Selection: Error attempting to evaluate mount options: [-5] Input/output error
Jun 08 02:11:24 henrique-pc mount[433]: Check your system logs for details on why this happened.
Jun 08 02:11:24 henrique-pc mount[433]: Try updating your ecryptfs-utils package, and/or
Jun 08 02:11:24 henrique-pc mount[433]: submit a bug report on [url]https://bugs.launchpad.net/ecryptfs[/url]
Jun 08 02:11:24 henrique-pc systemd[1]: home-henrique-secret.mount mount process exited, code=exited status=251
Jun 08 02:11:24 henrique-pc systemd[1]: Failed to mount /home/henrique/secret.
Jun 08 02:11:24 henrique-pc systemd[1]: Unit home-henrique-secret.mount entered failed state.
문제는 내 키링이 비어 있지만 비밀번호를 입력하라는 메시지가 표시되지 않는다는 것입니다. 하지만 실제로 메시지가 표시되어서는 안 되며 다음 스크립트를 사용하여 비밀번호를 로드해야 합니다.
#!/bin/sh
#
# /usr/local/bin/doecryptfs
exit $(/usr/sbin/pmvarrun -u$PAM_USER -o0)
파일을 구성 하고 system-auth
디렉토리 에서 다음을 사용했습니다 .login
gdm
/etc/pam.d
auth [success=ignore default=1] pam_exec.so quiet /usr/local/bin/doecryptfs
그러나 이것은 작동하지 않습니다.
한 가지 더 중요한 점:변수가 설정되지 않은 것으로 나타나 $PAM_USER
이로 인해 스크립트가 실패할 수 있습니다.
이 폴더를 마운트하려면 먼저 로그인하고( 항목 없이 /etc/fstab
) 키링에 비밀번호를 추가한 다음 mount.ecryptfs_private
명령을 사용하여 마운트할 수 있습니다.
튜토리얼이 좀 혼란스럽네요. 어느 순간 실수를 했는지 잘 모르겠습니다.