The :2e prefix appears to be a side effect of the netatalk service's default setting that disallows dotfiles; to avoid this (i.e. have the file names appear on the server as .DS_Store etc), add options:usedots
to each share in /etc/netatalk/AppleVolumes.default (see this previous question and the netatalk documentation).
This won't either get rid of the existing ":2e" files or prevent new "." files from being created, just make new files get created with saner names (and make them properly invisible). The DSDontWriteNetworkStores
setting you've done should prevent new .DS_Store files from being created, but won't prevent .TemporaryItems, .Trashes, ._* files (these are AppleDouble files that hold resources forks and nonstandard metadata), etc. I don't know of any way to prevent these from being created, you can only clean them up afterward (and hope they didn't have anything important in them -- this is not always a safe assumption).
I found a script by Christian Imhorst to delete various of these files on the server. The character encoding on his site is a little garbled, so I'll include a cleaned-up (and slightly modified...) version here. I've added a bit to the list of filenames to delete; feel free to edit the kill list to taste. But MAKE SURE YOU HAVE A BACKUP BEFORE RUNNING THIS, as any script that includes the characters "rm -rf" should be regarded as potentially dangerous.
#!/bin/bash
# Script: sauber
# Object: Cleans up your Linux file system after a
# session with AppleTalk and Finder.
# Etymologie: sauber means clean in German
# Author: originally by Christian Imhorst [http://www.datenteiler.de/what-is-2eds_store/]
# modified by Gordon Davisson
# Test number of arguments here
if (( $# < 1 )) ; then
echo >&2
echo "We need an argument here." >&2
echo "Usage: ./sauber [Directory]" >&2
echo "Example: ./sauber /home/christian" >&2
echo >&2
exit 1
elif [[ ! -d "$1" ]] ; then
echo "$1 is not a directory" >&2
exit 1
fi
find "$1" \( -iname ':2eDS_Store' \
-o -iname '.DS_Store' \
-o -iname '.AppleDouble' \
-o -iname 'Network Trash Folder' \
-o -iname 'Temporary Items' \
-o -iname ':2eTemporary Items' \
-o -iname '.Temporary Items' \
-o -iname ':2elocalized' \
-o -iname '.localized' \
-o -iname ':2e_*' \
-o -iname '._*' \) -exec rm -rf {} \;