Common Errors in Account Creation

Let us run you through some of the most common account creation errors, and provide information about the steps to troubleshoot them. 

Groupadd and Useradd Errors

There can be many reasons for receiving this error. 

Immutable files

If the immutable flag is contained in the /etc/passwd or /etc/group files, then the system is not able to edit them. Hence, the account cannot be added to your server. The below-mentioned commands can be run to check these files. 

  • lsattr /etc/group
  • lsattr /etc/shadow

If the immutable flag is contained in these files, then these will return to the output of these commands. 

You need to run the following commands for removing this flag. 

  • chattr -i /etc/passwd
  • chattr -i /etc/group

A corrupt group shadow file

If the /etc/gshadow file gets corrupted, the system is unable to add the account to your server correctly.

For each group in the /etc/groups file, the /etc/gshadow file needs to include a line in the group name::: format. In it, the term “groupname” represents the group name. Any /etc/gshadow file, which does not contain these lines, is corrupt. 

The below-mentioned steps need to be carried out for rebuilding corrupt files. 

1. Run the following command in order to move the existing file,  /etc/gshadow

    mv /etc/gshadow /etc/gshadow.corrupt

2. Run the grpconv command to rebuild the file. 

3. Delete the /etc/grshadow.lock and /etc/group.lock files, if these exist. 

Unable to add the user errors

If an unable to add the user error is returned by the system, it means that the user already exists on your system. In order to verify if the user already exists, you can carry out either of the below-mentioned steps.

  • Try to navigate to the /home/username directory. In it, the term “username” represents the account username. 
  • Check the contents of the /etc/passwd directory for that user’s entry. 

These are some of the most frequently encountered errors, along with the steps to troubleshoot these errors.

In the context of servers, HTS Hosting is renowned globally for providing fully secure, powerfully configured servers that are highly affordable. The Virtual Private Servers (VPS) of HTS Hosting are in high demand, be it the Self Managed Windows VPS, or the Self Managed Linux VPS, or the Managed Windows VPS, or the Managed Linux VPS. The benefits of using a VPS, combined with the high quality of service at low prices offered by HTS Hosting, form an unbeatable combination. That’s the reason for the ever-increasing popularity of HTS Hosting’s VPS among clients from all over the world, which include enterprises and businesses of all sizes, as well as individuals.