The Raspberry PI can be used as a file server by using Samba. Then, it is possible to access the "shares" from any Windows or Samba computer!

First, let's change the "hostname" of the Raspberry PI, by replacing in these two files any occurrence of raspberrypi by the desired host name:

sudo nano /etc/hostname
sudo nano /etc/hosts
sudo /etc/init.d/hostname.sh start

Then, let's install Samba on the Raspberry PI, assuming that some external USB drive is already mounted. First, let's install Samba concretely:

sudo apt-get update
sudo apt-get install samba
sudo apt-get install samba-common-bin

Then, choose a password for Samba, usually the same as for the Rapberry PI itself:

sudo smbpasswd -a pi

Configure Samba to share mounted drives and folders:

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.backup
sudo nano /etc/samba/smb.conf

Typically, the changes are as follows:

workgroup = WORKGROUP
security = user
socket options = TCP_NODELAY

And a share called GrownUpMovies, sharing the content of /media/GrownUpsMovies is created by:

path = /media/GrownUpsMovies
comment = Movies for grown-ups
valid users = pi 
writeable = yes 
browseable = yes

Finally, you can test your config. file using testparm, which should return something like:

Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[GrownUpsSeries]"
Processing section "[GrownUpsMovies]"
Processing section "[KidsSeries]"
Processing section "[KidsMovies]"
Loaded services file OK.
WARNING: You have some share names that are longer than 12 characters.
These may not be accessible to some older clients.
(Eg. Windows9x, WindowsMe, and smbclient prior to Samba 3.0.)
Press enter to see a dump of your service definitions

which means that everything is okay, because Loaded services file OK. So, you can restart the Samba server and enjoy your shares!

sudo /etc/init.d/samba restart

The last three changes:

Tygre - 2015-05-09 11:00:38 am  |  Tygre - 2013-04-29 09:02:49 am