How7o
  • Home
  • Tools
  • Prank Screens
  • Learn
  • Blog
  • Contact
Reading: How to Add a User to Pure-FTPd from the Command Line on Linux
Share
How7oHow7o
Font ResizerAa
  • OS
Search
  • Home
  • Tools
  • Prank Screens
  • Learn
  • Blog
  • Contact
Follow US
© 2024–2026 How7o. All rights reserved.
How7o > Free Laravel, PHP, WordPress & Server Tutorials > Server Management > How to Add a User to Pure-FTPd from the Command Line on Linux
Server Management

How to Add a User to Pure-FTPd from the Command Line on Linux

how7o
By how7o
Last updated: May 22, 2026
8 Min Read
Pure-FTPd add user command line — pure-pw useradd flow on Linux
SHARE

To pure-ftpd add user from the command line, you use the pure-pw useradd tool that ships with Pure-FTPd. The common pitfall — and probably the reason you ended up here — is the error “You must give (non-root) uid and gid”, which means the command needs a system user to map the virtual FTP user onto. This guide shows the full four-step flow that works on AlmaLinux, Rocky, RHEL 8+, Debian, and Ubuntu.

Contents
  • TL;DR
  • Step 1 — Pick or create the system user
  • Step 2 — Add the virtual FTP user
  • Step 3 — Rebuild the user database
  • Step 4 — Restart Pure-FTPd
  • Troubleshooting
    • “You must give (non-root) uid and gid”
    • Login succeeds but the user can’t see any files
    • Login fails with “Sorry, you don’t have any files in this account”
  • Frequently asked questions
  • Related guides
  • References

Last verified: 2026-05-17 on AlmaLinux 9 and Ubuntu 22.04 with Pure-FTPd 1.0.49+. Originally published 2023-01-06, rewritten and updated 2026-05-17.

TL;DR

# 1. Make sure a non-root system user exists
sudo useradd -m -s /sbin/nologin ftpuser

# 2. Add the virtual Pure-FTPd user, mapped onto that system user
sudo pure-pw useradd john -u ftpuser -d /home/ftpuser

# 3. Rebuild Pure-FTPd's user database
sudo pure-pw mkdb

# 4. Restart Pure-FTPd
sudo systemctl restart pure-ftpd

Step 1 — Pick or create the system user

Pure-FTPd uses virtual users — accounts that exist only inside Pure-FTPd’s own password database, not in /etc/passwd. But every virtual user has to be mapped onto a real system UID/GID so the kernel knows who owns the files. That’s what the “non-root uid and gid” error is telling you: you forgot the mapping.

If you don’t already have a system user dedicated to FTP, create one. The -s /sbin/nologin flag prevents anyone from logging into the system shell with this account — it’s only used as an ownership identity for FTP files.

sudo useradd -m -s /sbin/nologin ftpuser

Step 2 — Add the virtual FTP user

Now create the Pure-FTPd user with pure-pw useradd. The -u flag maps the virtual user onto the system user from step 1, and -d sets the FTP home directory:

sudo pure-pw useradd john -u ftpuser -d /home/ftpuser

You’ll be prompted twice for a password. After confirming, Pure-FTPd writes the new user to its plaintext database (typically /etc/pure-ftpd/pureftpd.passwd).

On some distros (notably Debian/Ubuntu builds where the system group of ftpuser doesn’t match the username) Pure-FTPd will also require the -g flag:

sudo pure-pw useradd john -u ftpuser -g ftpuser -d /home/ftpuser
Pure-FTPd add user flow — virtual FTP user mapped onto a non-root system user, then mkdb, then service restart

Step 3 — Rebuild the user database

Pure-FTPd doesn’t read the plaintext passwd file directly — it serves logins from a compiled binary database, pureftpd.pdb. The pure-pw mkdb command rebuilds that database from the plaintext file:

sudo pure-pw mkdb

Run this every time you add, edit, or delete a user. Skip it and the new login won’t work, even though the user shows up in pure-pw list.

Step 4 — Restart Pure-FTPd

sudo systemctl restart pure-ftpd

Strictly, restarting isn’t required just for adding a user — pure-pw mkdb is enough. But a clean restart is a good habit when you’ve also edited the Pure-FTPd config files alongside the user change, since it forces the daemon to reload its settings.

Try the new account from any FTP client:

ftp your.server.example
# Name: john
# Password: (the password you set in step 2)

Troubleshooting

“You must give (non-root) uid and gid”

You forgot the -u flag, or the system user you passed doesn’t exist. Pure-FTPd refuses to back a virtual user with root (UID 0) because that would let any FTP login write anywhere on the filesystem. Use a regular system user (id ftpuser should resolve to a non-zero UID).

Login succeeds but the user can’t see any files

The home directory passed to -d must exist and be readable/writable by the system user from step 1. Check ownership:

sudo chown -R ftpuser:ftpuser /home/ftpuser

Login fails with “Sorry, you don’t have any files in this account”

You skipped pure-pw mkdb. Run it and try again — Pure-FTPd needs the compiled .pdb file to be up to date.

Frequently asked questions

Why does pure-pw useradd say You must give (non-root) uid and gid?

Because Pure-FTPd refuses to back virtual FTP users with the root account — that would let any FTP login write anywhere on the filesystem. The -u flag tells pure-pw which non-root system user owns the FTP user’s files; without it, the command bails out with that error. The fix is to pass -u somesystemuser (a regular user that already exists on the box) and, if your distro requires it, -g somesystemgroup as well.

What’s the difference between the FTP username and the system user?

Pure-FTPd uses virtual users — they exist only in Pure-FTPd’s own database (pureftpd.passwd / pureftpd.pdb), not in /etc/passwd. Each virtual user is mapped onto a real system UID/GID that owns the files on disk. So you can have ten FTP usernames (alice, bob, carol…) all writing as a single system user like ftpuser, with permissions and quotas enforced per FTP login.

Do I need to run pure-pw mkdb every time I add a user?

Yes. pure-pw useradd only writes the human-readable pureftpd.passwd file. Pure-FTPd serves logins from the compiled pureftpd.pdb database, which pure-pw mkdb rebuilds from the passwd file. Skip this step and new users simply won’t be able to log in.

How do I list, change password, or delete Pure-FTPd users from the command line?

Use the same pure-pw tool. pure-pw list shows all virtual users, pure-pw passwd john changes a password (followed by pure-pw mkdb), and pure-pw userdel john removes a user. Every change to the passwd file requires a pure-pw mkdb afterwards for Pure-FTPd to see it.

Should I restart pure-ftpd after adding a user?

Strictly, no — pure-pw mkdb updates the database Pure-FTPd reads on each login, so new logins pick up the change immediately. The restart in this guide is defensive: it forces Pure-FTPd to re-read its configuration too, which is useful when you’ve also edited /etc/pure-ftpd/conf/* alongside the user change.

Related guides

  • How to Install Docker on AlmaLinux
  • Change the SSH Welcome Message on an Ubuntu VPS
  • Update Ubuntu to the Latest Kernel Version

References

Pure-FTPd documentation: pureftpd.org/project/pure-ftpd/doc. pure-pw manual page: man pure-pw on any system with Pure-FTPd installed.

TAGGED:BashconfigurationftpSSHtroubleshooting

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
[mc4wp_form]
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Copy Link Print
Previous Article XAMPP MySQL command line on Windows — fixing 'mysql' not recognized How to Access MySQL from Command Line in XAMPP on Windows
Next Article JavaScript check valid URL — URL constructor vs regex How to Check if a JavaScript String Is a Valid URL
Leave a Comment

Leave a Reply Cancel reply

You must be logged in to post a comment.

FacebookLike
XFollow
PinterestPin
InstagramFollow
Most Popular
Laravel Eloquent ORM — a model class mapping to a database table with query methods
Laravel Eloquent ORM: The Complete Guide to Querying Your Database
June 16, 2026
Set vi as the default editor in Ubuntu — a terminal opening the vim editor
How to Set vi (Vim) as the Default Editor in Ubuntu
June 8, 2026
rsync says ALL DONE but files are missing — a terminal showing ALL DONE next to an empty folder
rsync Says “ALL DONE” but Files Are Missing: How to Verify
June 8, 2026
Migrate a website to a new server with rsync — files copying from an old server to a new one over SSH
How to Migrate a Website to a New Server With rsync
June 8, 2026
Bun runtime — faster JS toolkit replacing npm in Laravel projects
How to Install Bun Runtime on Ubuntu (And Use It in a Laravel Project)
May 24, 2026

You Might Also Like

GitHub Actions workflow deploying Laravel to a VPS, zero-downtime symlink swap
Web Development

How to Deploy a Laravel App to a VPS with GitHub Actions (Zero-Downtime, No Forge)

11 Min Read
Laravel rollback specific migration — Artisan migrate:rollback --path command illustration
Web Development

How to Rollback a Specific Migration in Laravel

8 Min Read
PHP Bangladeshi number format — 1,00,23,456.79 grouping
Web Development

Format Numbers in Bangladeshi / Indian Style with PHP

6 Min Read
Laravel cURL error 60 SSL certificate problem — CA bundle wiring in php.ini
Web Development

How to Fix cURL Error 60 SSL Certificate Problem in Laravel

9 Min Read
How7o

We provide tips, tricks, and advice for improving websites and doing better search.

Tools

  • Age Calculator
  • Word Counter
  • Image Upscaler
  • Password Generator
  • QR Code Generator
  • See all tools→

Pranks

  • Fake Blue Screen Prank
  • Hacker Typer
  • Fake iMessage Generator
  • Windows XP Crash Prank
  • Windows 11 Update Prank
  • See all prank screens →

Company

  • About Us
  • Blog
  • Contact
  • Privacy Policy
  • Terms of Service
  • Sitemap
© 2024–2026 How7o. All rights reserved.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?