The data in /usr/local/directadmin/data/users is gone. I need to create it again.


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » DirectAdmin

The data in /usr/local/directadmin/data/users is gone. I need to create it again.Last Modified: Jan 8, 2018, 2:59 pm
A script has been created to create the default data for users.  All values will be set to unlimited, so you'll need to set any limits you want after the user account is recreated.

To fix a user and domain, let's assume values:
User Type
Username
Domain

Run it as:

cd /usr/local/directadmin/scripts
./fix_da_user.sh fred user domain.com


For Admin's and Reseller's, the 3rd domain option is optional.

Note that the script will not create a system user or modify any files under the user's' home directory. It's only to restore the data in /usr/local/directadmin/data/users so that the users can at least login.

If you want to change the any of the following values, you have to edit the script and change them (set near the top)

creator
ip
n1
ns2
package




If you have too many users to run fix_da_user.sh for each one, you can create this script in the scripts directory to get the user and domain from the /etc/virtual/domainowners file to create everything automatically:

#!/bin/sh

for i in `ls /usr/local/directadmin/data/users`; do
{
  echo "doing $i"
  for j in `grep ": $i" /etc/virtual/domainowners | cut -d: -f1`; do
  {
    echo "dmn: $j";

    ./fix_da_user.sh $i user $j

  };
  done;


  echo "";
};
done;

but manually fix the Admin and any Reseller accounts first, so they don't end up as Users.

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST