How to setup Samba client on Raspberry Pi

On the linux server
1. You need to add the user first, ‘guest’ won’t work.
: adduser –system shareuser
: passwd shareuser

2. Permission the share directory
: sudo chown shareuser:usergroup(or your username) sharedirectory/ -R

3. edit /etc/samba/smb.conf
add these below,
read only = no
browsable = yes
public = yes
writeable = yes
force user = shareuser

4. restart the smbd
sudo service smbd restart

On the Raspberry Pi
1. edit /etc/fstab
//ip or networkname/sambasharedirectory/ /localtargetdirectory cifs username=shareuser,password=shareuserpassword,noperm,uid=piusername,gid=groupname,_netdev 0 0
*example //192.168.0.111/sambadir/ /home/pi/samba cifs username=shareuser,password=1234,noperm,uid=pi,gid=pi,_netdev 0 0

2. mount them
: sudo mount -a

Leave a Comment