Pages

Sunday, June 14, 2020

Public Samba Share Ubuntu

 From:https://websiteforstudents.com/create-public-samba-share-ubuntu-17-04-17-10/

 

Step 1: Install Samba

The first thing you’ll need to do is install Samba. To install it run the commands below.
sudo apt-get update
sudo apt-get install samba
The commands above install Samba and all other dependencies.

Step 2: Create the Share

First, create the folder you  want to share with the public. The folder can be anywhere but set its permission so that everyone can access it. For this this tutorial, our share will be /home/Public
Run the commands below to create the folder you wish to share.
sudo mkdir /home/Public
Then set the share permission so everyone has full access to it.
sudo chmod 0777 /home/Public
sudo chown -R nobody:nogroup /home/Public

Step 3: Configure Samba

Now that Samba is installed, you must now configure it to provide file and print services to clients. This can be done by editing its default configurations file. First create a backup of the configuration file by running the commands below.
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
Next, run the commands below to open/create a new configuration file.
sudo nano /etc/samba/smb.conf
Then add the content below into the file and save. Our share will be called Public as defined in the setting below  [Public]
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = ubuntu
security = user
map to guest = bad user
name resolve order = bcast host
dns proxy = no
bind interfaces only = yes

# add to the end
[Public]
   path = /home/Public
   writable = yes
   guest ok = yes
   guest only = yes
   read only = no
   create mode = 0777
   directory mode = 0777
   force user = nobody
Save the file and exit

Step 4: Restart Samba

After configuring the setting above, restart Samba by running the commands below.
sudo systemctl restart smbd