Table of Contents

AutoFS

All Windows clients get mounted through autofs. This allows the backuppc backup task to run with 'tar' or 'rsync', which makes it much easier to manage permissions and file and directory excludes.

autofs installation

apt-get install autofs

Client configuration is done in a sub directory to /etc/backuppc, so keeping the autofs and backuppc configuration files in sync is easy. Point a link in autofs configuration directory to the machine configuration file and restart autofs.

# vim /etc/backuppc/autofs.d/samba.autofs
/mnt/machine /etc/backuppc/autofs.d/machine.autofs --timeout=10 --ghost # machine must be resolveable by the DHCP server, check with 'ping machine'

# vim /etc/backuppc/autofs.d/machine.autofs
C -fstype=cifs,ro,credentials=credentials-for-machine-file,uid=backuppc,gid=backuppc ://machine/C\$ # default samba share

# vim credentials-for-machine-file
username=user
password=password

# ln -s /etc/backuppc/autofs.d/samba.autofs /etc/auto.master.d/samba.autofs
# /etc/init.d/autofs restart

Put the credentials file into your home directory with permissions set to 600 and ownership of user. Now you can define machine.pl for backuppc using 'tar' or 'rsync'. Use '/mnt/machine/C' as share name.

Windows XP

Windows 7, 8, 10

Turn on network discovery
Turn on file and print sharing
Use user accounts and passwords to connect to other computers (Professional, Ultimate)

Other settings can be left at their default.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
DWORD LocalAccountTokenFilterPolicy=1
# dhcp server, eg. for dnsmasq:
root@<dhcp-server>:/etc/dnsmasq/dnsmasq.d # vim dnsmasq.local.conf
dhcp-host=00:00:00:00:00:00,machine-name,192.168.1.25 # enter this line to assign the machine with MAC address the name 'machine-name'

On the Windows client, you need to register the alias in the registry:

regedt32
key: "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters"
value: "OptionalNames"
content: machine-name
nmap -sP 192.168.1.0/24
smbclient '//clientname/C$' -U username

Interesting articles