The "421 Home Directory Not Available – Aborting" error occurs when a user tries to log in via FTP, SSH, or a web application, but their home directory is missing, inaccessible, or incorrectly configured. This is a common issue on Linux servers (such as Ubuntu, Debian, CentOS) with FTP services like vsftpd, Pure-FTPd, ProFTPD, or SSH.
This guide provides a detailed, beginner-friendly explanation of how to diagnose and fix the issue by recreating the home directory and ensuring correct configurations.
When a user logs into an FTP or SSH server, the system looks for their home directory as defined in /etc/passwd. If the directory does not exist or has incorrect permissions, the login attempt fails with the error:
This means:
/etc/passwd.To fix the problem, we will:
Before recreating the home directory, let's confirm whether it is missing.
Replace username with the actual username.
/home/username) is the user's home directory./bin/bash) is the default shell.It means the home directory is set to /nonexistent, and the system cannot find it.
Run:
drwx------) shows directory permissions.username username) indicate ownership.If the directory is missing, you will see:
In this case, proceed to Step 3 to recreate it.
If the home directory is missing, we need to recreate it.
Run:
The -p flag ensures the command does not fail if the directory already exists.
After creating the home directory, set its ownership to the correct user:
chown username:username sets ownership so the user can access it.
Run:
You should see:
Permissions must be at least 700 for private access or 755 for public access.
If the home directory was deleted, the user may also be missing essential files like .bashrc, .profile.
Run:
This copies default system files for a better user experience.
If the home directory exists but the error persists, check system settings.
/nonexistent, change it to /home/username:
If using FTP, restart the FTP service:
| FTP Server | Restart Command |
|---|---|
| vsftpd (Most Common FTP Server) | sudo systemctl restart vsftpd |
| ProFTPD | sudo systemctl restart proftpd |
| Pure-FTPd | sudo systemctl restart pure-ftpd |
If using SSH, restart the SSH service:
If the issue persists, consider these additional checks:
If the home directory exists but is inaccessible, check for low disk space:
If /home or / is full, delete unnecessary files.
If SELinux is enabled, it might block access to /home.
Run:
Then restart the system.
If quotas are enabled, check if the user has exceeded their disk quota:
If necessary, increase the quota.
To fix "421 Home Directory Not Available – Aborting", follow these steps:
ls -ld /home/username).mkdir -p /home/username).chown username:username /home/username).chmod 700 /home/username)./etc/passwd and restart services (systemctl restart vsftpd).Following these steps ensures the user can log in successfully and prevents future issues.