There are several places on the web to find tutorials on setting up a DNS-323 for Time Machine (for example: http://dns323.kood.org), but I couldn’t find sites that discussed setting it up a DNS-321. Here is what I did to get it working.
Root the DNS321 by installing fun_plug
- Download fun_plug and fun+plug.tgz
- Share the root of DNS-321 via samba (smb)
- Add executable rights to the fun_plug script (chmod +x in terminal) from your workstation
- Copy fun_plug and fun_plug.tgz to root of DNS321 and reboot (wait a bit as it takes a while to run)
Setup the root user account for SSH access
- Connect to the DNS-321 via Telnet :
$ telnet your.nas.ip.address
- Change the shell of the root account
~# usermod -s /ffp/bin/bash root
- Create a home folder for the root account
~# mkdir -p /ffp/home/root/
- Set the home folder of the root account to the be the folder that was created in the previous step
~# usermod -d /ffp/home/root/ root
If the above fails, manually edit the /etc/passwd file so the root account looks like this
root:x:0:0:Linux User,,,:/ffp/home/root:/ffp/bin/bash
Then, run the following command
~# pwconv
- Set the root account to have a password
~# passwd
- Login as the root account
~# login
- Save the root password you created by running the following command. This command invokes another shell (.sh) script which copies the password-related files to data partitions in Flash memory (mtd1 and mtd2).
~# store-passwd.sh
- Activate the SSH service by running the following commands:
~# chmod a+x /ffp/start/sshd.sh # sh /ffp/start/sshd.sh start
Install Netatalk (AFPD) on the DNS-321
- Modify /ffp/etc/netatalk/afpd.conf, adding the following to the bottom of the file
- -tcp -noddp -uamlist uams_dhx2.so,uams_clrtxt.so -setuplog "default log_info /ffp/var/run/afpd.log" -cnidserver localhost
- Install libgcrypt, libgpg-error, netatalk using slacker
~# slacker -Ui s:
- Install libdb5 by either compiling your own or using the one in the following forum: http://forum.dsmg600.info.
- Create two startup scripts: /ffp/start/afpd.sh and /ffp/start/cnid_metad.sh:
/ffp/start/afpd.sh~#!/ffp/bin/sh # PROVIDE: afpd # REQUIRE: cnid_metad . /ffp/etc/ffp.subr name="afpd" command="/ffp/sbin/$name" run_rc_command "$1"
/ffp/start/cnid_metad.sh
~#!/ffp/bin/sh # PROVIDE: cnid_metad # REQUIRE: LOGIN . /ffp/etc/ffp.subr name="cnid_metad" command="/ffp/sbin/$name" run_rc_command "$1"
- Make the scripts executable by running the following commands:
~# chmod +x /ffp/start/afpd.sh # chmod +x /ffp/start/cfid_metad.sh
- Create /ffp/etc/avahi/services/afpd.service and set its contents be as shown below:
<?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-group>
- Use the “vipw” command and change some details for the default “nobody” user so that Mac OS X can use that user to log in.
nobody:x:501:501:Linux User,,,:/home/nobody:/ffp/bin/bash
- Give a password to that user and store the password (in clear text) in the user’s home directory as shown here.
~# passwd nobody # cd /home # mkdir nobody # echo "secret" > nobody/.passwd # chown -R nobody: nobody
- Store this user’s information in the flash memory of the DNS-321. Do this by running the following command
~# store-passwd.sh
- Modify /ffp/etc/netatalk/AppleVolumes.default to add the required shares. Mine looks like:
~# The "~" below indicates that Home directories are visible by default. # If you do not wish to have people accessing their Home directories, # please put a pound sign in front of the tilde or delete it. # ~ /mnt/HD_a2/TimeMachine options:usedots,upriv,tm
- Start netatalk
~# /ffp/start/afpd.sh start
Install Avahi (bonjour) on the DNS-321
- Install libdaemon and avahi with slacker:
~# slacker -Ui s:
- Add an avahi user:
~# groupadd -g 50 avahi
~# useradd -u 50 -g avahi -d /tmp -s /bin/false avahi
- Create an avahi startup script called /ffp/start/avahi.sh that contains the following:
~#!/ffp/bin/sh # PROVIDE: avahi # REQUIRE: SERVERS . /ffp/etc/ffp.subr name="avahi" command="/ffp/sbin/avahi-daemon" avahi_daemon_flags="-D -s" required_files="/ffp/etc/avahi/avahi-daemon.conf /ffp/etc/avahi/hosts" start_cmd="avahi_start" avahi_start() { # need avahi user and group for priviledge separation if ! grep '^avahi:' /etc/passwd >/dev/null; then echo 'avahi:x:50:50:Avahi Daemon:/no/where:/bin/false' >>/etc/passwd fi if ! grep '^avahi:' /etc/shadow >/dev/null; then echo 'avahi:*:14493:0:99999:7:::' >>/etc/shadow fi if ! grep '^avahi:' /etc/group >/dev/null; then echo 'avahi::50:avahi' >>/etc/group fi proc_start $command } run_rc_command "$1"
- Make the file executable so that avahi starts when the DNS-323 boots:
~# chmod +x /ffp/start/avahi.sh
- To change the icon for the DNS-321 that shows up in Mac OS X Finder, create the file /ffp/etc/avahi/services/device-info.service and set its contents to the following:
<?xml version="1.0" standalone="no"?><!--*-nxml-*--> <service-group> <name replace-wildcards="yes">%h</name> <service> <type>_device-info._tcp</type> <port>0</port> <txt-record>model=RackMac</txt-record> </service> </service-group>
- Launch avahi
~# /ffp/start/avahi.sh
You should now see your DNS-321 show up in Finder.