Switch language
zh
Switch theme
Light
  • linux 设置 smb

    install sudo apt update sudo apt install samba set share folder # /etc/samba/smb.conf # append below lines [smb_share] path = /data/smb_share comment = parent folder write list = @sambashare valid users = @sambashare writeable = yes add user # first: add linux user # -M: don't create home directory # -s: set shell (no login) sudo useradd -M -s /sbin/nologin smb_jackma # second: set user to sambashare group sudo usermod -aG sambashare smb_jackma # thire: bind to smb sudo smbpasswd -a smb_jackma (type password) set privilege /data/smb_share: chown 设置 root:root, 子文件夹不允许用户删除 /data/smb_share/foler1: chown 设置 sambashare:sambashare, 所有 smb 用户均可访问、编辑、删除文件; 同时设置 chmod 2770 让新创建的文件(夹)有同样的 group(smabashare) /data/smb_share/folerx: chown 设置 smb_groupx:smb_groupx, 只有当 smb 用户属于 smb_groupx 组时, 才有该文件夹的 wrx 权限 ps:
🍀