How to share folders on the Pi using Apple Filing Protocol (AFP)
Apple Filing Protocol is Apple's proprietary network protocol for distributing files over the network. This is Apple's replacement for the Server Message Block (SMB) and Network File System (NFS) protocols.
Following this guide, you will be able to share any folder on your Raspberry Pi using AFP and easily connect to them from your Mac OS X device.
All of this is possible with the Netatalk software. The software implements the AFP protocol at the server level, allowing the Raspberry Pi to distribute files through it.
Setting up AFP on Raspberry Pi
Step 1. Now, before you can set up AFP on your Raspberry Pi, you must ensure that the operating system is up to date.
To make sure everything is up to date, run the two commands below.
sudo apt update sudo apt upgrade
Step 2. With the Raspberry Pi now up to date, you can now go ahead and install the package that will take care of everything. The package you are installing is called Netatalk. Open source Netatalk is used to implement the free Apple Filing Protocol (AFP).
Install the Netatalk application onto the Raspberry Pi by running the following command.
sudo apt install netatalk
Step 3. After installing Netatalk software, now you have to continue configuring it to share different folders.
First, let's look at how to add folders for sharing. To do this, you must modify the afp.conf file by running the command below.
sudo nano /etc/netatalk/afp.conf
Step 4. In this file, add the following text at the end.
Add home folders
[Homes] basedir regex = / home
This block identifies the home directories. This block will allow any connected users to access their respective home directories.
Identify 'basedir regex' so that the Netatalk software knows where to find the user's home directory.
If you want to lock users to a specific directory in their main path, you can add the following option. Where is the name of that directory.
[Homes] basedir regex = / home path =
Add custom folders
[My AFP Share Name] path = / path / to / directory
Using something like above, you can share any folder you want.
In square brackets ([]) specifying when to start sharing is the name given to the sharing.
The option 'path =' is the path to the folder you want to share over the AFP protocol.
Create a share as an Apple Time Machine
[My AFP Share Name] path = / path / to / directory time machine = true
You can specify any sharing as a shareable time machine, by simply adding the option 'time machine = true' below.
Share read-only
[My AFP Share Name] path = / path / to / directory read only = true
If you want the share to be read-only, all you have to do is add 'read only = true' to it. This option is useful for sharing, such as sharing media library.
Set up a guest account
[Global] guest account = pi
You can specify the guest account to use for connections by setting "guest account = 'in the' [Global] 'header. By default, this is set to' nobody '.
More information on available options can be found by visiting the Netatalk configuration documentation at.
http://netatalk.sourceforge.net/3.1/htmldocs/afp.conf.5.html
Step 5. Once changes to the configuration are complete, you can go ahead and save the file by pressing CTRL + X then pressing Y, and then pressing ENTER.
Step 6. Since you have made changes to the Netatalk configuration, it is necessary to restart the service so that it can use the new configuration.
Restart the service by running the following command.
sudo systemctl restart netatalk
7. Before connecting to the newly shared folders, you should retrieve the IP address assigned to the Raspberry Pi. Make sure you have an active network connection using either WiFi or an Ethernet cable. Write this IP down as you will need it to connect to the shared drive.
sudo hostname -I
Connect to Pi's AFP sharing process on Mac OS X
Step 1. To connect to the AFP sharing process on Raspberry Pi, start by opening the Finder app available on Mac OS X.
Step 2. Now go ahead and click 'Go' on the toolbar at the top of the screen. Next, click on the option 'Connect to Server…'.
Step 3. In this dialog box, you will need to enter the Raspberry Pi's IP address after 'afp: //'.
For example, with the Raspberry Pi's IP address being '192.168.0.159', you need to type 'afp: //192.168.0.159' into the input box. Once entered, click the 'Connect' button to continue.
Step 4. When connecting to your Raspberry Pi, you will be greeted by a dialog box asking you to enter your username and password to connect to the Apple Filing Protocol server.
Since the article is only for the default user, the example uses "pi" as the name and "raspberry" as the password. After entering the user to connect, go ahead and click the 'Connect' button to continue.
Step 5. After successfully logging into the Raspberry Pi's AFP share, you will now be asked which volumes you want to mount.
This dialog box displays all the folders that you set up earlier in the tutorial, each referenced by the name you put next to that share in the configuration file.
Select the volume you want to mount. Then click the OK button to continue.
Step 6. Finally, you should be able to view your mounted shares to your Mac OS X device.
Below, the post has included a screenshot showing the networked drives in "Locations" in the sidebar. The example also shows shared volumes in the Finder app.
At this point, Apple Filing Protocol is running on your Raspberry Pi. You can also use a MAC OS X device to successfully connect to your shared folders via the AFP protocol.
You should read it
- How to Synchronize Folders
- How to share a folder (folder) via LAN on Windows 10
- How to synchronize specific folders and share folders in Dropbox
- How to share folders, drives in Windows
- How to Create a Flawless Filing System on Your Computer
- How to Share a Folder
- Set a password for the folder, set a password for the folder or folder using Folder Guard
- What is a folder The concept of a file (File) and a folder (Folder) in a computer
May be interested
- 5 ways to share files and folders from OneDrive in Windows 10share folders or files for one or more others easily and simply with onedrive in windows 10. if you don't know the steps yet, refer to the article below.
- How to share a folder (folder) on Windows 10sharing folders via lan is often used in offices, where many people work together. to share a folder on windows 10 via lan, follow the steps below:
- How to share files and folders on Google Drivecurrently google drive has been widely used by many young people to store data and documents online. in addition to being able to view and download documents on many different devices, google drive is also loved by its rich and diverse file and data sharing feature. so how can you share files and folders on google drive?
- 7 small tips with folders in Windowsas we all know, every folder on windows is used to store and manage many different data. today, we will share with you 7 small tricks to use those folders more effectively, not simply copying or deleting data in it. please consult.
- How to Sync Foldersthis article shows you how to share folders with other computers on your network. this allows any computer on the network to access and change files in the shared folder. you can share and access folders on windows and mac operating systems; however, the computer that contains the shared folder and the computer that has access to the folder must be on the same wireless (or wired) internet network. if you just want to synchronize a folder on your computer with a local folder or flash drive, you can use the freefilesync program.
- How to Access Public Folders in Outlook 2016 on PC or Macthis wikihow teaches you how to access public folders in outlook 2016. public folders in outlook are folders used to share information with large groups of people, such as an entire department or campus. public folders have access...
- How to share an estimated arrival time on Apple Mapsin the latest version of apple maps that comes with ios 13, apple has added a share eta feature that allows you to share your scheduled time to the location with friends or family members, allowing them to track progress. your schedule in real time throughout the trip.
- How to Share a Folderdo you have multiple computers attached to your home network? you can increase efficiency and easily share between all of your computers by creating shared folders. these folders can be accessed by any other computer on the network that...
- Popular network protocols todaythere are many protocols while establishing a connection on the internet. based on the type of connection to be established, the protocols used are also varied. these protocols define the characteristics of the connection.
- 5 folders on macOS you should not touchapple does hide some folders. cluttering these folders can make the system unstable. the following article will show you where to not touch in the macos file system.