Create an SMB/CIFS share on Ubuntu


  • Install samba

sudo apt-get update
sudo apt-get install samba

  • Set the samba password for the user account that will be used with the share

sudo smbpasswd -a userName

  • Keep in mind that the user must already exist or a Failed to add entry for user error message will be thrown.
  • Create a directory to mount the share

mkdir /mnt/smbShare

  • Add the share config to the bottom smb.conf file

sudo nano /etc/samba/smb.conf

path = /mnt/smbShare
available = yes
valid users = userName
read only = no
browseable = yes
public = yes
writeable = yes

  • Restart SMB

sudo service smbd restart

  • Test accessing the new share.
    • If accessing from a Windows box then the username needs be pre-fixed with the name of the server hosting the SMB share
      • i.e. UserName admin should be UbuntuServer\admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.