Sunday, April 12, 2015

Samba server installation

Update: December 11, 2015
Add Mac window diagrams at the end of this post.

1. Connect Raspberry Pi to the internet

2. Update and upgrade with these commands:
sudo apt-get update
sudo apt-get upgrade

3. Install Samba with these commands:
sudo apt-get install samba
sudo apt-get install samba-common-bin

4. Edit the config file:
sudo nano /etc/samba/smb.conf

Ctrl+W to search for 'security' and remove the '#' sign before:
security = user

Add the following lines to the bottom of smb.conf:

[RPi]
comment = My Raspberry Pi
path = /home/pi/share/
public = no
writable = yes
browseable = yes
create mask = 0777
directory mask = 0777

Save the changes.


5. Type this command:

sudo smbpasswd -a pi

Type the password 'raspberry' twice.


6. Check the status:

sudo service samba status

To restart the server, type:

sudo service samba restart

7. Create the share folder

mkdir share

8(a). Use a Windows PC to connect in networks to the Raspberry's IP address (ifconfig), not in browser (otherwise it will connect to Apache server).


Enter the password.
(Sorry the interface is in Chinese)


Copy a file to Raspberry Pi.

Check that the file has been successfully copied to the share folder.

8(b). Use a MAC to connect to Raspberry Pi.

In Safari URL, type in:

smb://192.168.xxx.xxx (Raspberry Pi's IP address)

This brings up the password dialog below.

Select RPi

The photo copied from Windows PC to Raspberry Pi is shown.

Congratulations! The Samba server is working!

Update: December 11, 2015
Add Mac window diagrams in Chinese.

Select 'Finder'
Choose 'Go' -> 'Connect to server'.

Enter the server IP address.

Enter the user name and password.

Drag a file to RPi in Finder.

Open the file manager of Raspberry Pi.
Now the file can be seen if the share folder.


No comments:

Post a Comment