Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to share directory over SMB using Samba Server Configuration

📅 2014-Apr-13 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ nfs, smb ⬩ 📚 Archive

Share a directory over SMB

You can share a directory on your computer using NFS, as described in this post. Another alternative is to share it over SMB using Samba, especially if you have Windows computers on your network. This can be a great way to share your family photos, music and video files to all the notebooks, phones and tablets connected on your home network.

Samba Server Configuration is a simple GUI utility that makes configuration and sharing directories over SMB extremely easy. For every directory you share using this utility, it adds the relevant section to your /etc/samba/smb.conf file.

Installing this utility is easy:

$ sudo apt-get install system-config-samba

To run the utility type Samba in the Dash or sudo system-config-samba at the shell.

Adding a directory to share is easy. Choose File > Add Share and provide the directory path, the name it should appear as in SMB, choose whether it should be writeable and visible.

In the Access tab, choose whether you want everyone to access the directory or just some specific users. If you choose everyone then no login or password is required by SMB clients to access this shared directory. If you pick some users, then the SMB clients need to provide one of those user and password to access this shared directory. Choose Add and you are done.

For sharing with everyone, you need an extra customization. Find the section in /etc/samba/smb.conf that refers to the shared directory and provide an username that should be forcefully used when anyone accesses this share:

    path = /home/joe/pics
    guest ok = yes
    ; Add the line below
    force user = joe

To restart the Samba server after making these changes:

$ sudo service smbd restart

Tried with: system-config-samba 1.2.63 and Ubuntu 14.04

© 2023 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 Mastodon📧 Email