差異處
這裏顯示兩個版本的差異處。
| 下次修改 | 前次修改 | ||
| samba [2017/01/04 00:03] – 建立 127.0.0.1 | samba [2023/06/11 00:58] (目前版本) – jz | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | |||
| ====== samba ====== | ====== samba ====== | ||
| + | |||
| + | ====== install ====== | ||
| < | < | ||
| - | pkg install | + | pkg install |
| + | sysrc samba_server_enable=" | ||
| </ | </ | ||
| + | |||
| + | ====== config ====== | ||
| + | / | ||
| + | < | ||
| + | [global] | ||
| + | workgroup = WORKGROUP | ||
| + | server string = CSNA Server | ||
| + | netbios name = csna | ||
| + | wins support = Yes | ||
| + | security = user | ||
| + | passdb backend = tdbsam | ||
| + | |||
| + | [public] | ||
| + | path = / | ||
| + | writable | ||
| + | browsable = yes | ||
| + | read only = no | ||
| + | guest ok = yes | ||
| + | create mask = 0644 | ||
| + | directory mask = 0755 | ||
| + | hosts allow = 140.116.0.0/ | ||
| + | |||
| + | [homes] | ||
| + | path = /home/%U | ||
| + | writable | ||
| + | browsable = yes | ||
| + | read only = no | ||
| + | guest ok = no | ||
| + | create mask = 0644 | ||
| + | directory mask = 0755 | ||
| + | hosts allow = 140.116.0.0/ | ||
| + | </ | ||
| + | |||
| + | ====== public share ====== | ||
| + | user has all permission on his/her own file, but can not delete others. | ||
| + | < | ||
| + | mkdir / | ||
| + | chmod 3777 / | ||
| + | </ | ||
| + | |||
| + | ====== start service ====== | ||
| + | < | ||
| + | service samba_server start | ||
| + | </ | ||
| + | |||
| + | ====== add samba user account ====== | ||
| + | < | ||
| + | smbpasswd -a CSNA2016 | ||
| + | </ | ||
| + | |||
| + | ====== mount ====== | ||
| + | < | ||
| + | sudo mount -t cifs -o vers=3.0, | ||
| + | sudo mount -t cifs -o vers=3.0, | ||
| + | </ | ||
| + | |||
| + | ====== List shares ====== | ||
| + | < | ||
| + | smbclient -L ip_of_net_interface -U your_user_name | ||
| + | </ | ||
| + | |||
| + | |||