I have long been a user of Apple products. An old MacBook completely copes with the tasks that are assigned to it. Mostly entertaining, of course. But lately there has not been enough space on a 40 gig hard drive. And finally, my hands were itching to set up my home server as storage. Some time worked on ftp, but it was not convenient. It was decided to finally set up Appletalk, no wonder he is there and at the same time to tame TimeMachine to it :-)
The configuration of all this can be divided into several stages:
1. Install Appletalk
2. Setting up AppleTalk
3. Installing Avahi
4. Configure Avahi
5. Configure TimeMachine
Well, let's get started.
1. Install AppleTalk
')
Netatalk package - opensource Appletalk service implementation (AFP server). Mac OS X requires encryption support, but the standard build of this package does not support encryption. Therefore it is necessary to rebuild this package.
Here you can download the already correctly assembled package, and go to step 2.
But it is better to assemble yourself by executing these commands:
Download raw:
cd /tmp
sudo apt-get build-dep netatalk
sudo apt-get source netatalk
cd netatalk-2*
Install what you need to build:
sudo apt-get install cracklib2-dev fakeroot libssl-dev
We collect:
sudo DEB_BUILD_OPTIONS=ssl
sudo export DEB_BUILD_OPTIONS
sudo dpkg-buildpackage -rfakeroot
And, if everything is in order, install:
sudo dpkg -i ../netatalk_2*.deb
Everything is not as scary as it seemed. So that when updating the system, the correct package is not replaced by a newer but not correct package for the netatalk package:
echo "netatalk hold" | sudo dpkg --set-selections
Everything, now we will pass to setup.
2. Setting up AppleTalk
First you need to disable those services that are not needed to solve the current task. Here is the section in the / etc / default / netatalk file to this:
ATALKD_RUN=no
PAPD_RUN=no
CNID_METAD_RUN=yes
AFPD_RUN=yes
TIMELORD_RUN=no
A2BOOT_RUN=no
Now it's time for the main configuration file /etc/netatalk/afpd.conf and add this line below:
- -transall -uamlist uams_randnum.so,uams_dhx2.so,uams_guest.so -nosavepassword -advertise_ssh
Now we are going to configure the resources that will be shared by afp. This is configured in the /etc/netatalk/AppleVolumes.default file
Line:
/home/torrent/downloads "Torrent-Downloads" allow:username,nobody rolist:nobody cnidscheme:cdb options:usedots
Shares the folder / home / torrent / downloads under the name Torrent-Downloads for user username and guest user. And the Guest can only read from this folder.
Line:
/home/username/TimeMachine "TimeMachine" allow:username1,username2 cnidscheme:cdb options:usedots,upriv
sharing resource for TimeMachine.
After editing configs, restart netatalk:
sudo /etc/init.d/netatalk restart
Avahi installation
After the above steps, you can use Finder to access shared resources. But every time it’s not convenient to use this menu, you need to make sure that the afp server is visible in the Finder resource menu.
For this we need Avahi. Avahi is a daemon providing online services like Bonjour.
Installing avahi is simple:
sudo apt-get install avahi-daemon
sudo apt-get install libnss-mdns
In the /etc/nsswitch.conf file in the line, starting with hosts, you need to add mdns at the end, like this:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns
4. Configure Avahi
Create a /etc/avahi/services/afpd.service file with the content:
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=Xserve</txt-record>
</service>
</service-group>
And restart avahi:
sudo /etc/init.d/avahi-daemon restart
Now the vault should have appeared in the left sidebar of the Finder.
5. Configure TimeMachine
In the poppy console you need to run the command:
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
That's all.