Share a folder via Samba on Raspberry Pi 3

Share a folder from Raspbian 9 (stretch) is pretty simple.

Check samba status

You need to check if samba already installed and running.

Type in your terminal:

The output must be the version number of the installed samba version:

To check if it’s running, type (you mast be root or sudoers):

If samba is running it will show different information on the service PID, user, machine, shred folders and so on. In this case skip the next paragraph.

Install samba server

If samba is not correctly installed type (you mast be root or sudoers):

Configure your samba server

It’s now time to configure your samba server.

Let’s go to edit the smb.conf located in /etc/samba (I’ll use nano editor). Type:

Change the following entries:

and ADD to the end of the file the share setting for your folder:

Where SHARE_FOLDER_NAME is the name you want to give to this share, ANY_COMMENT is just a comment, PATH_OF_THE_SHARED_FOLDER is the path of the folder to share (for ex. if I want to share my home folder it is: /home/stefano ).
To save just press CTRL+X and confirm with Y.

Setup a password

It’s time to setup a password for your user. Type:

where username is your local username. Provide a new password.

Restart the server

To restart the server and make all change available, type:

Connect to your share

Now you can try to connect to your samba server.

For example: in Mac OS X you can press from a Finder window Command+k (+k). In the server address type smb://IP_ADDRESS_OF_YOUR_SERVER/SHARE_FOLDER_NAME and provide your Username and your Password that you previously created.

Enjoy.

You may also like...

Leave a Reply

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