Installing and configuring Samba

Samba is a very convenient application to have running for a home media server, as it allows easy access to files from other computers on the local network. Here, Samba is configured to be used with authentication and authorization. In other words, a username and password must be used in order to access Samba's shared folders from any network connection. In order to access the folders, they will be mapped to a local drive on the non-BeagleBone system. Then, the Samba share will appear as a local drive on the non-BeagleBone system, even though it is actually a folder on the BeagleBone. On the Windows operating system, this is easily accomplished by the map network drive option. This option is available by right-clicking on the shared folder in a File Explorer window.

To install samba, use the following command:

sudo apt-get install samba

Sometimes, there are extra packages that need to be installed in addition to the package you want to install. After reading the details of these packages, select Y to continue, as shown in the following screenshot:

Installing and configuring Samba

Now, a password is needed to access the server from other remote clients. The user will be the default user (debian). To set the password, run the following command:

sudo smbpasswd –a debian

The following screenshot shows how to set the SMB password for the debian user:

Installing and configuring Samba

Now, /etc/samba/smb.conf will be changed to increase security and remove some unnecessary settings.

First, ensure that the Samba shares can only be accessed by devices on the local network by restricting the IP addresses that Samba will respond to. This is done by adding the following lines in the #### Networking #### section:

hosts allow = 127.0.0.1 192.168.1.0/24
hosts deny = 0.0.0.0/0

Make sure that the hosts allow line reflects your local network settings. Your local subnet may be different from the X.X.1.0/24, as shown in the previous command.

Next, make sure that the following line is present and uncommented in the ####### Authentication ####### section:

security = user

This will ensure that the only people who can access Samba shares are those who have a valid Debian account on the BeagleBone.

Now, you need to comment out any of the lines pertaining to printers because the BeagleBone is not going to be attached to any.

Anything in the ;[printers] section should be commented out with a ";".

Later on in Chapter 4, Installing and Setting Up a BeagleBone RAID System, when the external RAID array is attached, the smb.conf file will need to be edited and the Raid array will need to be entered in to allow access over Samba.

This entry will then become the "mapping" point on the non-BeagleBone system and will appear as a local drive. This will be where the video, audio, and pictures will be stored.

To do this, the following lines are entered:

#Share for the Raid array
[media]
  Comment= Raid array connected to BeagleBone
  path = /media/<Raid mount point>
  read only = no
  browseable = yes
  valid users = <debian>

Now, enter the reboot command to restart Linux.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.144.108