Creating a Linux User
Overview
This guide walks you through the process of creating a Linux user account outside of cPanel. This may be necessary for specialized use cases such as SSH-only access or non-cPanel-managed file uploads.
Strongly discourage proceeding with this unless absolutely necessary.
This is NOT recommended due to the following security concerns:
1. The user will not be managed by cPanel.
2. Files uploaded by this user won’t follow standard cPanel permission policies.
3. User will not have access to WHM, cPanel, or phpMyAdmin.
If you need to access MySQL, you can still create a database user in cPanel and connect using a MySQL client.
Step 1: Create the Linux user
Run the following command via SSH as the root user:
useradd developer
This creates a user named developer with its own home directory.
Step 2: Set a password for the new user
passwd developer
You’ll be prompted to enter and confirm the password.
Step 3: Grant access to a specific directory
To allow this user to access a specific directory (e.g., /home/example), set the appropriate file access control:
setfacl -R -m u:developer:rwx /home/exampleStep 4: Verify permissions
Check the permissions to confirm they were applied correctly:
getfacl /home/example You should see output similar to:
user::rwx
user:developer:rwx
group::--x
mask::rwx
other::--x
If the other permission is not set to --x, correct it with:
setfacl -m o::--x /home/example
Step 5: Add the user to the directory group (Optional)
If needed, add the user to the group that owns the directory:
usermod -a -G example developerStep 6: Test access restrictions
To confirm security is intact, create a test user:
useradd testuser
su - testuser
cd /home/example
Try running:
ls -l
touch testfile.sh
If access is denied, the permission restrictions are working as expected.
How to remove the user later
If you no longer need this user, you can delete them with:
userdel developerTo confirm they were removed:
su - developerYou should see an error like:su: user developer does not exist
Summary
Creating a Linux user outside of cPanel is possible for advanced use cases like SFTP-only access. However, this method bypasses cPanel’s security and automation features, so proceed with caution and only when no other option fits.