X

Debian Samba Server 快速架設

臨時需要一個空間, 然後要能讓 Windows 存取來燒資料, 最簡單的就是架個 Samba Server, 透過網路芳鄰來存取.

順便紀錄 快速架設 Debian Samba Server 的過程.

Debian 架設 Samba 很簡單, 只要下述步驟即可:

安裝 samba server package

  • apt-get install samba smbfs

設定 /etc/smb.conf

  • vim /etc/smb.conf

主要設定下述幾個地方: 

  1. workgroup = Workgroup # 看 Windows workgroup 設什麼而定
  2. security = share # 大家都可以直接存取
  3. guest account = nobody # 來存取的人都用 nobody user 進來

設定要分享的目錄

再來於 smb.conf 最後加入要分享的目錄和權限(下述加在 smb.conf 結尾即可)

[share]
comment = Share Dir
path = /mnt/share
guest ok = yes
writable = no
share modes = yes

再來 /etc/init.d/samba reload 即可.(可用 testparm 確定設定是不是自己想的, 看有沒有設錯)

如果是其它 Debian 要掛載此 Samba Server, 如下步驟即可:

  1. apt-get install smbfs # 需要支援 smbfs
  2. 下述指令假設此台 IP 是 192.168.1.1, 且打算 mount 到 /mnt/tmp 上.
  3. mount -t smbfs -o password='' //192.168.1.1/share /mnt/tmp
  4. 這樣子就可以到 /mnt/tmp 看掛載結果囉.
Tsung: 對新奇的事物都很有興趣, 喜歡簡單的東西, 過簡單的生活.
Related Post