Samba

出自Gea-Suan Lin's Wiki
於 2024年3月6日 (三) 01:52 由 Gslin留言 | 貢獻 所做的修訂
跳至導覽 跳至搜尋

Samba是一個提供SMB協定的軟體。

安裝

大多數的Linux套件都有提供,在Ubuntu下可以用apt安裝:

sudo apt install -y samba; sudo apt clean

設定

設定會在/etc/samba/smb.conf,建議將原來檔案先備份到/etc/samba/smb.conf.bak

#
[global]
    workgroup = WORKGROUP
    server string = %h server (Samba, Ubuntu)
    log file = /var/log/samba/log.%m
    max log size = 1000
    logging = file
    panic action = /usr/share/samba/panic-action %d
    server role = standalone server
    map to guest = bad user
    usershare allow guests = yes

[samba-shared]
    comment = samba-shared
    path = /srv/samba-shared
    guest ok = yes
    read only = no
    public = yes
    writable = yes

然後重新啟動:

sudo service smbd restart

防火牆

使用UFW

sudo ufw allow from 192.168.0.0/16 to any app Samba

其他

新版的Windows在client端會阻擋使用guest當入Samba,會需要透過gpedit修改允許:

外部連結