Click here for a free subscription to "HDE" our site newsletter.

Raspberry Pi Beginner Projects: Making The File System Visible

Integrating with your network

Wouldn't it be nice if you could browse the file system of your Raspberry Pi from anywhere on your network just like you can with Windows networking? Well you can, it's quite easy to do so off we go...

It's worth mentioning quickly that once you have set up your Pi as follows you will not only be able to use the Windows file explorer to browse files on your pi but you will also be able to use the hostname to connect to it with PuTTy and WinSCP and others. This means that you won't have to remember it's IP address and rediscover it every time your router gives it a new one.

Install SAMBA:

pi@raptor ~ $ sudo apt-get install samba samba-common-bin

When I did this install it took quite a while so be patient.

Change the working directory to /etc/samba:

pi@raptor ~ $ cd /etc/samba
pi@raptor /etc/samba $

There are going to be a number of operations to perform that require you to have root permissions so to avoid excessive typing of sudo you can start a root shell to do it all in:

pi@raptor /etc/samba $ sudo bash
root@raptor /etc/samba#

Notice that the prompt has changed to "root@..." and ends with a '#' instead of a '$'

You can now edit the smb.conf file and strip out all the comments and defaults to improve performance. First rename the file so that you can use it to recreate the original:

root@raptor /etc/samba# mv smb.conf smb.conf.master

Now edit the file with nano:

root@raptor /etc/samba# nano smb.conf.master

In the section ### Authentication ### find the line:

# security = user

Remove the '#' at the start of the line. This will require everyone who accesses the Pi's file system to be linux users on the Pi.

In the section [homes] find the line:

# read only = no

remove the '#' to uncomment it. This allows for files to be written to as well as read across the SAMBA network.

Save the file:


And exit:


Now strip out all the unnecessary stuff from the file and save it back to the original:

root@raptor /etc/samba# testparm -s smb.conf.master > smb.conf

Restart the SAMBA service:

root@raptor /etc/samba# service samba restart

Exit the root bash shell:

root@raptor /etc/samba# exit
pi@raptor /etc/samba $

Finaly set a password on the SAMBA network for the user 'pi'. This is the password that you will need to access the Pi's file system from your network. It is not the same as the Linux login for the same user:

pi@raptor /etc/samba $ sudo smbpasswd -a pi

Enter a suitable password when prompted and you are done.

You can now access your Pi's file system from any machine on your network just like you would for any Windows system. You can also use the hostname to access a terminal with PuTTY and files with WinSCP.

Now subscribe to our newsletter and don't miss a thing


No comments yet.

Add Comment

* Required information
(will not be published)
Bold Italic Underline Strike Superscript Subscript Code PHP Code Quote Insert line Bullet list Numeric list Link Email Image Video
Smile Sad Huh Laugh Mad Tongue Crying Grin Wink Scared Cool Sleep Blush Unsure Shocked
Enter code:
Notify me of new comments via email.
Remember my form details on this computer.
I have read and understand the privacy policy. *
I have read and agree to the terms and conditions. *
Click here for a free subscription to "HDE" our site newsletter.