Backing up user account list

Hi,

Is it possible in Virtualmin to backup user account data to a secondary source just in case the first ever becomes unavailable?

I currently store all user accounts in LDAP and have this configured from within Virtualmin via the official documentation. However, I wanted to also store this account information in, for example, /etc/passwd and /etc/shadow (the traditional Linux method) so that if my LDAP server ever becomes unavailable, my Virtualmin system can fall back to retrieving account details from the local machine.

Is this possible? If so, how would I set this up to backup my LDAP user account info to /etc/passwd on my Virtualmin machine periodically? Thanks!

Status: 
Active

Comments

There's nothing built into webmin to do this specifically. However, in the case of an LDAP failure, you could re-configure your system to use local password files, and then do a restore of just Virtualmin mailboxes from your regular backups to re-populate the /etc/passwd file.

Would there be a way to do this automatically upon an LDAP failure (or, for example, Webmin's System and Server Status monitors detecting an LDAP failure)? Also, what about virtual server accounts in addition to mailbox users?

There's no built-in way to automate it (and we are unlikely to implement one), but you could in theory write your own script to do this. However, I wouldn't recommend it - the damage from such a script going wrong would probably be worse than a short-term LDAP outage.

What do you mean? Would you mind elaborating on this damage a bit further?

Any time you restore user accounts, there's always the risk of something going wrong and deleting them