Skip to content
mlawren edited this page Sep 13, 2010 · 4 revisions

NAME

userdeb – create custom Debian package from user account

SYNOPSIS

userdeb [ options ]   [ < login > ]

DESCRIPTION

userdeb bundles a user account (login information, home directory files, and desired dependencies) into a Debian package. This can be useful for making a very complete individual backup, or as a way of duplicating your personal environment across multiple machines.

As sensitive data may be included (for example gpg/ssh keys), all files are encrypted inside the package. The user is prompted for a password during the build phase, and the same password given during package installation decrypts the files.

The generated package can be safely removed after it is installed, leaving all of your files in place. Purging the package is equivalent to a ’userdel -f -r’. Re-installation behavior – how to handle conflicts between locally modified files and new package files – is configurable.

The root user may specify to build a package for another user.

Installation Actions

The following steps take place during package installation.

Account Creation

The user account is created with the same gecos and shell as on the current system, but with no password (unless userdeb has been run as root).

Account Groups

The user is added to the same groups as the current system, provided they already exist on the target system.

Email Address

If an entry for the user was found in /etc/email-addresses it is duplicated on the target system.

Email Aliases

Any entries matching the login name in /etc/aliases are duplicated on the target system.

Sudoers Entry

If an entry for the user was found in /etc/sudoers it is duplicated on the target system (only if userdeb has been run as root)

File Decryption & Replacement

All files in the package are decrypted. If the ’-o’ option has been used then existing files are unconditionally overwritten. Else new files are named $file.userdeb-new in the event of an existing, modified file.

Custom actions can also be specified (see CONFIGURATION below).

Options

The following command-line options are recognized by userdeb.

-d Turn on debug output during source package creation.

-v Turn on verbose output during the package build

-s Source only – do not build the package. You should only use this if you are interested in the details of how the package source is created. Future invocations of userdeb will clobber any changes!

-k Keep the package source around after the build phase. You should only use this if you are interested in the details of how the package was built. Future invocations of userdeb will clobber any changes!

-o Unconditionally overwrite existing files on the target system with new ones.

CONFIGURATION

Customization of the package can be made through the following configuration files located in ~/.userdeb/ (automatically created on the first run).

Lines beginning with ’#’ and those that are empty are ignored.

manifest

The manifest file specifies which paths to include in the package.

It contains a list of paths (one per line) relative to the users home directory. They are expanded using the standard ’glob’ method allowing you to use constructs such as ’.bash* ’. If a path expands to a directory then all files underneath are included.

The default is a single ’ .* ’ – i.e. all configuration files (and configuration directories) under /home/login/ are included.

To include everything in your home directory you add a line containing just ’ * ’. However, be aware that building a package requires twice the amount of space on the disk as the included files, so you will not be able to build this if your /home is on a filesystem that is more than one-third full.

depends

A list of package names, one per line, upon which this package will depend. Version information can be specified exactly the same way as in a debian/control file.

conflicts

A list of package names, one per line, with which this package will conflict. Version information can be specified exactly the same way as in a debian/control file.

FILES

The ’/usr/share/user-/unlock’ script included in the new package is responsible for the decryption of files. It can be used in the event
that things do not succeed during installation (wrong password, unattended install, etc).

SEE ALSO

dpkg-buildpackage(1), equivs(1), ccrypt(1)

AUTHOR

Mark Lawrence <nomad@null.net>

COPYRIGHT AND LICENSE

Copyright © 2009 Mark Lawrence <nomad@null.net>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Clone this wiki locally