At times, when restoring your directadmin accounts on a new server, you’ll notice an unusual error. While most of the accounts will be restored successfully, a few will return error with the message, “XYZ is not a valid user”.
Messages like these is enough to scare the admins who presume they have deleted something unexpectedly. But the problem is something else.
In most cases, it’s the username length that creates this error. The length exceeds the set limit which triggers the DirectAdmin to throw an error. In this article, learn how to fix this error.
The Solution
Fixing this error is simpler than you think. You need to edit the directadmin.conf configuration file and change the max_username_length parameter. This is the parameter that decides how long the username should be. If it’s set to 10, then the username cannot be more than 10 characters. Otherwise, you’re going to see this error.
To fix the “DirectAdmin: is not a valid username” error, you need to increase the parameter to 20 or more. So the username character length can be up to 20 or 30 and so on.
Follow the steps:
The error should now get resolved.
Messages like these is enough to scare the admins who presume they have deleted something unexpectedly. But the problem is something else.
In most cases, it’s the username length that creates this error. The length exceeds the set limit which triggers the DirectAdmin to throw an error. In this article, learn how to fix this error.
The Solution
Fixing this error is simpler than you think. You need to edit the directadmin.conf configuration file and change the max_username_length parameter. This is the parameter that decides how long the username should be. If it’s set to 10, then the username cannot be more than 10 characters. Otherwise, you’re going to see this error.
To fix the “DirectAdmin: is not a valid username” error, you need to increase the parameter to 20 or more. So the username character length can be up to 20 or 30 and so on.
Follow the steps:
- Connect to your server using SSH and with root credentials
- Run this command to edit the directadmin.conf file -
Code:
[root@server ~]# vi /usr/local/directadmin/conf/directadmin.conf
- Find and edit the username length with this command -
Code:
max_username_length=20
- Save and exit the editor
- Restart with this command -
Code:
/sbin/service directadmin restart