無聊測試在 FreeBSD 安裝 Debian Buster Jail Chroot 的成功或失敗筆記
Setting up a (Debian) Linux jail on FreeBSD
openrc
等套件 (不刻意拔 systemd
,apt update
遇到 mmap 問題的 workaround檔案系統選擇:
iocage
…等選定 jail 所在 root 目錄
debootstrap
pkg install debootstrap
debootstrap --foreign --arch=amd64 buster /zroot/iocage/jail/debian10 http://debian.ccns.ncku.edu.tw/debian/
(自行改成你喜歡的 Debian 鏡像站,可以加上 --include="sysv-rc locales locales-all"
等套件)dpkg --force-depends -i /var/cache/apt/archives/*.deb
來源:
docker export $container_id > rootfs.tar
(on linux environment)tar -xvf rootfs.tar -C /zroot/iocate/jail/debian10/root/
(in FreeBSD jail host)設定 jail 後,把 Debian jail 打開
/etc/apt/apt.conf.d/99aptcache
), 使 apt update
可以繞過 mmap 相關問題APT::Cache-Start 1000000000;
/etc/apt/source.list
,加入 stretch-backports
,使 Debian Stretch 可以測試使用較新的部份套件 (not updated)kldload pty
使 Debian 上面的 sshd 可以被連線pty
這個模組才能讓 Debian 的 openssh/dropbear 登入成功後開啟 shell?/dev
上面的東西 (例如 share memory) 在 Debian jail 仍無法設定正常使用,影響到 PttBBS, (OpenSSH server, DropBear 可能有但相對問題較少),是 FreeBSD jail 的安全機制? 有方法可以設定? (to be checked)explicit_bzero()
相關函式,可能少裝哪些套件或是少設定某些參數?bbsadm
權限使用 /home/bbs/bin/mbbsd -D -e utf8 -h 127.0.0.1 -u new
執行 non-daemon 模式完整功能bbs@jailhost:~/pttbbs$ git log --oneline
fb827331 (HEAD -> master) Makefiles: let libraries in common/fbs be compiled optionally
829b9d8b (origin/master, origin/HEAD) mbbsd: UI fixes on email verification
4d2b3185 mbbsd: Remove the old reg code logics
6bdd3689 mbbsd: Warn admin when changing email to those which would be rejected
b50d0274 mbbsd: Fix not deleting email in userec_t when deleting it from verifydb
c9f7a031 mbbsd: Remove extra space between options
446c2bc3 Use a good srandom seed
6c792c1a Use a good random source for captcha codes
7296640e Fix /recover not working in shell login
c5eff6a6 mbbsd: Do CAPTCHA test before going into account recovery
4696318d sample: Add password changed notice email template
c98a8cd3 mbbsd: Audit log for password reset
689313fb sample: Add recover account email template
89bf7422 mbbsd: Implement account recovery
debian {
host.hostname = debian.local.test; # Hostname
interface = alc0;
ip4.addr = *****; # IP address of the jail
ip6.addr = *****;
path = "/compat/debian"; # Path to the jail
exec.start = "/etc/init.d/rc 3"; # Start command
exec.stop = "/etc/init.d/rc 0"; # Stop command
persist;
devfs_ruleset = "4"; # devfs ruleset
mount.devfs; # Mount devfs inside the jail
mount.fstab = /etc/fstab.debian;
allow.sysvipc;
# allow.raw_sockets;
# allow.mount;
# allow.mount.devfs;