Mind Dump, Tech And Life Blog
written by Ivan Alenko
published under license CC4-BY
posted in category Systems Software / Samba
posted at 27. Mar '24

Howto Share Samba With Regular User

Sometimes I need to copy over some media files to my second computer and I still like to use windows sharing for that instead of SSH. Fortunately Samba allows to share a directory quite easily (once I knew what I want) without configuring smb.conf and it is called usershares. Physically each share is a plaintext file somewhere in /var/lib/samba/usershares.

  • install Samba - apt-get install samba
  • option 1:
    • install sharing plugin to Dolphin (apt-get install kdenetwork-filesharing)
    • or Thunar (not sure, not in Debian, but I heard it exists)
    • open Dolphin or Thunar
    • right click on a folder
    • click Properties
    • click Sharing tab
    • share it
  • option 2 (command line):
    • add user to samba - smbpasswd -a myuser
    • add share directory - net usershare add Video /home/damon/Videos "my videos" user:F n
    • later delete - net usershare delete "my videos"
    • list current shares - net usershare list
    • details about share like permissions - net usershare info "my videos"

Further reading: - https://wiki.archlinux.org/title/samba, section Enable Usershares

And that’s all.

Add Comment