# Linux sandboxing 問題: 1. hako 的功能為何? 2. hako 如何運用在本專案? 3. 如何改進 hako ? 可以從官網中看到有關 hako 功能的描述: - chroot + Linux namespace - run on a read-only filesystem - privilege dropping (早期階段) - Networking-> 沙盒可以使用 host 端或是其他沙盒的網路 ### 解析程式碼: ### 0. creating 建立 sandbox 並對其配置 ```c $ mkdir sandbox $ mkdir sandbox/.hako $ touch sandbox/.hako/init $ chmod +x sandbox/.hako/init $ mkdir sandbox/bin $ touch sandbox/bin/busybox $ ln -s busybox sandbox/bin/sh ``` 之後要加入整個 debian 檔案系統 #### 1. hako-enter.c #### 2. hako-run.c 照著 README 的指示輸入 `hako-run sandbox /bin/sh` 命令時會遇到 `hako-run: command not found` ,要輸入 `sudo ./hako-run sandbox` 才能進入 sandbox 使用上的差異: `hako-run --pid-file sandbox.pid sandbox` 與 `hako-enter --fork $(cat sandbox.pid) /bin/sh` ?? ### 加入 debian 檔案系統 在 [建立 Debian root file system](https://hackmd.io/@devaraja/build-Debian-root-file-system) 有提到如何建立 debian 檔案系統以及如何驗證,因此在此處聚焦在如何用
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up