Home MiscellaneousHow to Fix “No such file or directory: /home/user1/etc/domain.com/passwd” in cPanel

How to Fix “No such file or directory: /home/user1/etc/domain.com/passwd” in cPanel

by SupportPRO Admin
Realistic photo of a server administrator troubleshooting a cPanel email error on a desktop computer, terminal window open with directory commands visible

While creating an email account in cPanel, you may encounter the error:

No such file or directory: /home/user1/etc/domain.com/passwd

This error typically means the system cannot find the required directory structure to generate mailbox configuration files.

In most cases, the issue occurs because the etc directory inside the user’s home folder is missing or was accidentally deleted.

Let’s understand why this happens and how to fix it safely.

Why This Error Occurs

When an email account is created in cPanel, the system automatically generates configuration files inside:

/home/username/etc/domain.com/

Inside this directory, cPanel creates the passwd file, which stores mailbox configuration details.

If the /etc directory does not exist inside the user’s home path, the mail system cannot create the required file. As a result, you see the “No such file or directory” error.

This is a directory structure issue — not a mail server failure.

Step-by-Step Fix

Step 1: Connect to the Server via SSH

Log in as root or a privileged user.

Step 2: Create the Missing Directory

Run:

mkdir /home/user1/etc

Replace user1 with the actual cPanel username.

Step 3: Set Correct Permissions

Assign proper permissions:

chmod 0750 /home/user1/etc

This ensures:

  • The owner has full access
  • The group has limited access
  • Others have no access

Step 4: Set Correct Ownership

The directory must have the correct owner and group so the mail service can write to it.

chown user1:mail /home/user1/etc

Where:

  • Owner: user1 (cPanel username)
  • Group: mail

Incorrect ownership is a common reason why the issue persists even after creating the folder.

Step 5: Retry Email Creation

Go back to cPanel and try creating the email account again.

If permissions and ownership are correct, the system will automatically generate:

/home/user1/etc/domain.com/passwd

The error should now be resolved.

Additional Troubleshooting Checks

If the issue continues:

Verify Domain Folder Exists

Check whether:

/home/user1/etc/domain.com/

exists after creating the email.

Check Mail Service Status

On most cPanel servers running Exim:

systemctl status exim

Make sure the mail service is active.

Run cPanel Maintenance Scripts (If Needed)

On servers running WHM:

/scripts/updateuserdomains
/scripts/mailperm

These scripts repair domain and mail permissions.

Why This Folder Goes Missing

Common reasons include:

  • Manual deletion inside /home/username/
  • Incorrect restore from backup
  • Migration errors
  • Permission misconfiguration
  • Incomplete account transfer

Prevention Tips

  • Avoid manually deleting system folders inside /home/username/
  • Perform regular backups
  • Audit directory permissions after migrations
  • Use official account transfer tools in WHM

FAQ

Is this a mail server failure?

No. The error occurs because a required directory inside the user’s home path is missing.

Can this happen after account migration?

Yes. Improper account migration or partial restore can remove critical directories.

What permissions should the etc folder have?

Recommended:

Group: mail

Permission: 0750

Owner: cPanel username

If you require help, contact SupportPRO Server Admin

Partner with SupportPRO for 24/7 proactive cloud support that keeps your business secure, scalable, and ahead of the curve.

Contact Us today!
guy server checkup

You may also like

Leave a Comment