Your wish is my command

It’s a long journey

Jail

Build Jail

# setenv D /here/is/the/jail
# mkdir -p $D
# cd /usr/src
# make buildworld
# make installworld DESTDIR=$D
# make distribution DESTDIR=$D
# mount -t devfs devfs $D/dev
# du -sh $D
192M    /usr/jail/hello_jail
# adduser test

Run Jail

# jail $D test.jail.woosum.net 192.168.0.1 /bin/sh /etc/rc
  • 여기서 마지막의 command는 jail상의 path임..
  • make distribution으로 만든 jail 디렉토리를 단순 복사하면 jail이 실행 안됨

기타

jail 시스템과 베이스 시스템은 커널을 공유한다.

jail은 process와 그 자식 프로세스를 완전히 분리시킨다.