From 5d5ff4027eff6fa9b9907de89ddb665c4b93a06d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B3=BB=E7=B5=B1=E7=AE=A1=E7=90=86=E5=93=A1?= Date: Fri, 6 Mar 2026 06:07:28 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E6=8E=9B=E8=BC=89=20SMB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- %E6%8E%9B%E8%BC%89-SMB.md | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 %E6%8E%9B%E8%BC%89-SMB.md diff --git a/%E6%8E%9B%E8%BC%89-SMB.md b/%E6%8E%9B%E8%BC%89-SMB.md new file mode 100644 index 0000000..081ef10 --- /dev/null +++ b/%E6%8E%9B%E8%BC%89-SMB.md @@ -0,0 +1,67 @@ +# 1. 安裝 CIFS 工具 + +```bash +apt update && apt install -y cifs-utils +``` + +# 2. 建立 SMB 驗證檔 + +```bash +nano /root/.smbcredentials +``` + +(內容如下) + +``` +username=SMB帳號 +password=SMB密碼 +domain=WORKGROUP +``` + +設定權限 + +```bash +chmod 600 /root/.smbcredentials +``` + +# 3. 掛載 SMB 資料夾 + +```bash +nano /etc/fstab +``` + +(加入以下內容) + +``` +///emby /mnt/ds918/emby cifs credentials=/root/.smbcredentials,uid=100000,gid=100000 0 0 +``` + +uid=100000,gid=100000:對 unprivileged LXC container 很重要,這樣權限會對應到 container 內的 root 使用者(id 100000) + +若是 privileged container,可用 uid=0,gid=0 + +```bash +nano /etc/pve/lxc/.conf +``` + +(加入以下內容) + +``` +mp0: /mnt/ds918/emby,mp=/emby +``` + +# 4. 建立掛載的資料夾 + +```bash +mkdir -p /mnt/ds918/emby +``` + +# 5. 重新掛載資料夾 + +```bash +systemctl daemon-reload +``` + +```bash +mount -a +``` \ No newline at end of file