Guide - Setting up a SMB(Windows) file server
#1
This quick and easy tutorial will show you how to set up a shared folder on your Rock64 and host it via SMB/CIFS to share it amongst Windows/Mac/Linux Clients. 

I will also show you how to connect to it using Googles Android client. 
_____________________

Prerequisites: 

Rock64 Board running Linux , Connected via Ethernet or Wifi

Know the IP address/Hostname of your board, SSH access. 

Basic knowledge of how to use the linux terminal


Suggested:


An external drive to host the Shared Directory

Basic understanding of how linux handles USB drives and File Permissions



____________________

I will continue this tutorial off from the last one, and I will set up the shared directory in the Flash drive. 


Firstly, you'll need to update your repositories and install any pending updates. This is good practise before installing software on any linux system. Debian/Ubuntu use the "apt" package management tool. You'll need superuser access for this. 


Code:
sudo apt update && sudo apt upgrade 


Type in your password when prompted and 'y' when prompted to install updates. 


After that, you'll need to invoke apt to install the samba server: 


Code:
sudo apt install samba samba-common-bin


[Image: t8pJbWu.png?1]

Depending on your distro, samba-common-bin may already be installed. However, allow the other supporting software to be installed. 

The next step is to create a directory to host the network share. In this senario, I will be placing it in the Flash drive mentioned in the tutorial listed at the top. 

Navigate to your mounted FS location. Following the previous tutorial, for me it is: 

Code:
cd /media/USB-test3/


Make a new directory which will act as the shared location. We will create it with Use/Write/Execute permissions for everybody inside the folder: 


Code:
sudo mkdir -m 1777 RockShare



Now we can edit Samba's configuration file to create a new share based on the directory we just set up: 


Code:
sudoedit /etc/samba/smb.conf



[Image: ZB2fLBd.png?1]

Use the Up/Down or PageUp/Down keys to navigate to the bottom of the file to create a new entry.

Code:
[share]
Comment = Rock64 Share
Path = /media/USB-test3/RockShare
Browseable = yes
Writeable = Yes
only guest = no
create mask = 0777
directory mask = 0777
Public = yes
Guest ok = yes



[Image: 7hKk4mK.png?1]


These options means that anybody can read, write or execute files in the share, either with a samba user or as a guest. To forbid guest access, simply omit the "guest ok" line. 


Now we can create a specialized user for samba, if you'd like to have your share accessible only with the proper credentials. 

First of all, you need to make a new linux user. In this case, I will be making a new user "rocksmb": 


Code:
sudo useradd rocksmb


After that, you can create a new samba user, and you'll be prompted to type in a password too. This is a unique password, independent to your linux user password: 


Code:
sudo smbpasswd -a rocksmb
New SMB password:
Retype new SMB password:
Added user rocksmb.
 

Now you restart the samba service: 

Code:
sudo /etc/init.d/samba restart
[ ok ] Restarting nmbd (via systemctl): nmbd.service.
[ ok ] Restarting smbd (via systemctl): smbd.service.
[ ok ] Restarting samba-ad-dc (via systemctl): samba-ad-dc.service.

Now your Samba share will be visible and accessible! 

There are many guides about how to access smb shares using Windows: 

https://www.howtogeek.com/176471/how-to-...and-linux/

http://www.techrepublic.com/article/how-...indows-10/

https://www.linux.com/news/using-samba-s...nd-windows

Mac OS: 

https://support.apple.com/en-au/HT204445

Ubuntu: 

https://help.ubuntu.com/stable/ubuntu-he...nnect.html


In all cases, replace the hostname/IP in the guide with the ones you have. 



_________________

If you want to access the drive using mobile apps, there are many apps available on both Android and iOS. 


iOS: https://itunes.apple.com/us/app/fileexpl...82524?mt=8

Android: https://play.google.com/store/apps/detai...ider&hl=en


I dont have an iphone, so I'll do a quick rundown using the android app: 


Download it and upen it to be greeted to a very simple credential screen. Simply fill in the details like:

Code:
smb://HOSTNAMEORIP/SHARE



In our case: 

[Image: ZBN8LZA.png]

Assuming you've put in the right credentials, it will immediately open up the share using the default android file selector: 

[Image: uW5A7bx.png]

However Google's app is VERY rudimentary and barebones. I was able to open image files, but video and audio files gave me problems unless I copied them to internal memory. 

If you need something more full featured, I highly recommend solid explorer: 

https://play.google.com/store/apps/detai...rer2&hl=en
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Beginners Guide: Migrating to SSD rontant 18 39,665 01-19-2022, 09:30 AM
Last Post: Ellesar Dragon
Information Beginners Guide: Adding USB Storage, Linux Formatting and Permissions Ptheven 4 12,221 03-06-2021, 01:49 PM
Last Post: helpmerock
  Step by step guide PXE diskless configuration. burglar_ot 13 35,636 11-01-2020, 11:26 PM
Last Post: michael.gruner
Thumbs Up A guide for how I made RetroPie, RetroArch, and EmulationStation Work on the Rock64 Mrfixit2001 4 16,029 12-17-2018, 03:52 AM
Last Post: va88
  Guide - XRDP - Debian Stretch / Ubuntu Xenial / OMV S3phi40T 3 13,962 05-05-2018, 06:08 AM
Last Post: S3phi40T
Information Guide - Raid Array (Raid 0) Ptheven 0 4,810 10-07-2017, 09:22 AM
Last Post: Ptheven
Information Guide - Setting up a NFS Share Ptheven 0 5,463 09-26-2017, 04:44 AM
Last Post: Ptheven
Information Beginners Guide: Locating your board, connecting to it. Ptheven 5 15,847 08-21-2017, 04:12 AM
Last Post: Ptheven

Forum Jump:


Users browsing this thread: 1 Guest(s)