smb-share-linux.md 1.3 KB


title: SMB Share Linux date: 2021-04-17 categories: [cheatsheets]

tags: [SMB, misc, share, samba]

SMB Share from Linux

  • Installation:

    sudo pacman -Sy samba
    
  • Add a SMB user

    sudo smbpasswd -a <username>
    
  • Use the following config for sharing a folder

  • Path: /etc/samba/smb.conf

    [global]
    workgroup = WORKGROUP
    dns proxy = no
    log file = /var/log/samba/%m.log
    max log size = 1000
    client min protocol = SMB2
    server role = standalone server
    passdb backend = tdbsam
    obey pam restrictions = yes
    unix password sync = yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
    pam password change = yes
    map to guest = Bad Password
    usershare allow guests = yes
    name resolve order = lmhosts bcast host wins
    security = user
    guest account = nobody
    usershare path = /var/lib/samba/usershare
    usershare max shares = 100
    usershare owner only = yes
    force create mode = 0070
    force directory mode = 0070
    
    [share]
    comment = documents
    browseable = yes
    read only = no
    create mask = 0755
    directory mask = 0755
    valid users = <username>
    path = /home/juan/documents/
    guest ok = yes
    writable = yes
    available = yes
    public = yes