Share folder across your network using Mint (Ubuntu…) and mount on Raspberry Pi (Raspbian)

Share folder across your network and mount on your Raspberry Pi

On server – where the files will actually be saved – verify if you have already installed client and server for ssh (openssh-client, openssh-server), then I recommend you to follow the steps describe in allboutlinux to install and configure samba.

The procedure describe next is the one detailed in allaboutlinux post, all credit to their post (I just added some personal experience):
Installing Samba -lets update first the repositories – open a terminal and type the following :

sudo apt-get update

now install samba

sudo apt-get install samba

Now, for the next step I recommend you to create the share folder under root /, for example:

mkdir /share_folder

(why? the folder is under the root / directory because I was having errors when using longer paths (/home/dvs/share_folder) when I tried to mount it on the Raspberry Pi, the folder was not found! Why? I could not understand…I double check if it was the correct path, and it was…then, I changed for the shorter path and it works, I appreciate if you can enlighten me on this one πŸ˜‰ )

now lets edit the configuration file of samba, but before that lets backup the initial configuration file.

cd /etc/samba/
sudo mv smb.conf backsmb.conf

(ATTENTION: if you had some extra configurations than the ones by default they are now in the backsmb.conf, you have to adapt these next steps to your case, for example copy (cp) instead of (mv))

Setup public folder – first we will create the configuration for a share folder accessible from everyone without any user need it

sudo nano smb.conf

for that add the following to this file:

workgroup = Workgroup
server string = My Samba Share %v
security = user
map to guest = bad user
dns proxy = no
comment = This is a folder accessible from everyone
path = /sharefolder
browsable = yes
guest ok = yes
read only = no
create mask = 0755

Now, we have to give permissions to the folder:

sudo chown -R nobody:nogroup /sharefolder/
sudo chmod 755 /sharefolder/

now lets restart the samba server

sudo /etc/init.d/smbd restart

“Normally at that point you should be able to access this share folder from Linux or Windows without any user credentials.”

On client – the place where you mount the folder, for example into your Raspberry Pi – add line on /etc/fstab – follow the instructions on geeks.noeit:

// /home/pi/from_share cifs guest,uid=1000,gid=1000,iocharset=utf8 0 0

[server] [share_folder] [path on client] – for more information follow the geeks.noeit post

Mount it:
sudo mount -av


Useful command – to know which folders are shared:
/usr/bin/smbclient -L
[IP do server]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: