We will learn how to access files on our Raspberry Pi using Samba.
Thanks to Samba, we can use Windows file sharing on Linux.
In this tutorial, We are going to
- Install samba module
- Share piget’s folder
- Protect all shared folder with a password
- Learn how to fix issues on Windows
- See what’s inside piget’s folders
- Create a report
- Share all files on a Raspberry pi
- See all the other commands
To install a module on Piget, we just need to type this on our terminal:
- Install samba module
Samba is installed (if it wasn’t already), then a default password is created. No files are shared.
Password : raspberry
To share piget’s folders, type
This will set up and restart samba
Before we go to the files on our Raspberry Pi, we should change the default password.
Tape this to change password and type your password twice.
You can access shared folders in Network on Windows explorer
If you have previously entered a different password, this may have been cached by Windows, we can’t change it and an error message will be displayed.
There are 3 ways to fix this:
- close and open your session
- restart your computer
- Type these commands on the command line as an Administrator (Shortcut : WINDOWS-X then A)
net stop workstation
net start workstation
We are going to see what we have shared.
Click on your Raspberry Pi in Network and enter pi as your username and password
In boot folder, we can store files that will be available on the boot partition on our Raspberry Pi.
This partition is the only one that can be access on Windows, when you plug your sd card on your computer.
This partition only have 37 megas, so you shouldn’t store anything except text files.
We are going to use this partition to create a text file which will explain what is installed on your Raspberry Pi.
To generate a report, type :
This will create logBook.txt on your SD card.
This file contain a list of installed modules, the name of our Raspberry Pi, the IP address of our Raspberry Pi.
Here is an example of a log :
The folder Piget contains all piget’s scripts and softwares.
You can see and modify how Piget works here.
However if you update your Raspberry Pi by typing :
All modifications will be lost, except if you create a new module, will see how on another tutorial.
Finally, you can store all your personal files in the user folder.
- You can save your own scripts in /user/scripts
- No setting is saved inside piget folder , there are saved inside /user/config
We will see how to share all folders on the Raspberry Pi.
We have now access to all folders.
Once you don’t need it anymore, stop sharing files to avoid unwanted access to your Raspberry Pi.
There are more settings available on samba modules
To code a website, you can share /var/www , by typing :
You can share the user folder only, by typing :
There is a automatically generated documentation available at http://github.com/pigetnet/samba