chroot에 ecryptfs 홈 자동 마운트(schroot 사용 시)

chroot에 ecryptfs 홈 자동 마운트(schroot 사용 시)

내 호스트 시스템은 Archlinux이고 내 홈 디렉토리의 파일과 함께 사용할 수 있는 우분투 환경이 필요합니다. 문제는 내 홈 디렉토리가 ecryptfs를 사용하여 암호화된다는 것입니다. 그래서 schroot를 시작하면 다음과 같은 결과를 얻게 됩니다.

 ~ $ schroot -c ubuntu-lts
(ubuntu-lts) ~ $ ls
Access-Your-Private-Data.desktop  README.txt

암호화된 홈 디렉토리를 자동으로 마운트하려면 어떻게 해야 합니까(아마도 비밀번호를 다시 입력하지 않고).

Archlinux에서 암호화된 홈페이지를 설정하기 위해 다음 단계를 수행했습니다.

내 schroot 설정은 매우 간단합니다.

~ $ cat /etc/schroot/chroot.d/ubuntu-lts.conf
[ubuntu-lts] 
type=directory 
description=Ubuntu 18.04 LTS
directory=/opt/schroot/ubuntu-lts 
users=<my username>
aliases=ubuntu-18.04,ubuntu-bionic,bionic

답변1

얼마 후 나는 해결책을 찾았습니다.

루트 설정:

[ubuntu-lts]
type=directory
description=Ubuntu 18.04 LTS
directory=/opt/schroot/ubuntu-lts
users=<your-username>
aliases=ubuntu-18.04,ubuntu-bionic,bionic
setup.fstab=ubuntu-lts/fstab

fstab 파일은 다음과 같습니다.

# fstab: static file system information for chroots.
# Note that the mount point will be prefixed by the chroot path
# (CHROOT_PATH)
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/proc           /proc           none    rw,bind         0       0
/sys            /sys            none    rw,bind         0       0
/dev            /dev            none    rw,bind         0       0
/dev/pts        /dev/pts        none    rw,bind         0       0
/home           /home           none    rw,bind         0       0
/tmp            /tmp            none    rw,bind         0       0
/home/<your-username>   /home/<your-username>   none    rw,bind         0       0

# It may be desirable to have access to /run, especially if you wish
# to run additional services in the chroot.  However, note that this
# may potentially cause undesirable behaviour on upgrades, such as
# killing services on the host.
#/run           /run            none    rw,bind         0       0
#/run/lock      /run/lock       none    rw,bind         0       0
#/dev/shm       /dev/shm        none    rw,bind         0       0

이것은 /etc/schroot/default/fstab에서 /etc/schroot/ubuntu-lts/fstab로 복사된 fstab 파일이며 여기에 다음 줄을 추가했습니다.

/home/<your-username>   /home/<your-username>   none    rw,bind         0       0

관련 정보