Linux Create An FTP User Account

Now your FTP server is up and running. It is time to add additional users to FTP server so that they can login into account to upload / download files. To add a user called tom and set the password, enter:
# adduser -c 'FTP USER Tom' -m tom
# passwd tom

Now tom can login using our ftp server. Make sure the following is set in vsftpd.conf


Restart the vftpd:
# service vsftpd restart

However, I recommend setting virtual FTP user account to increase server security.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 14 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
14 comments… add one
  • Chris Dec 21, 2009 @ 18:21

    These instructions seem to get the server running, but I’m unable to connect with any local user. It keeps telling me my password is invalid, even though I can ssh with that username/password just fine.

    Status: Connection established, waiting for welcome message…
    Response: 220 (vsFTPd 2.0.5)
    Command: USER ftpuser
    Response: 331 Please specify the password.
    Command: PASS ********
    Response: 530 Login incorrect.

    • brewski Nov 3, 2011 @ 5:43

      I had the same issue. I had to add the ftp users to the ‘ftp’ group:

      # gpasswd -a ftpuser ftp

      and then it worked.

  • Vamsi Jan 1, 2010 @ 20:40

    Hi..can we predefine path of the user directory instead of /home/tom ?

    • brewski Nov 3, 2011 @ 5:46

      For a new user you would do:

      # useradd -m -G ftp -s /sbin/nologin -d /home/ftpuser ftpuser

      (This also sets the login shell to /sbin/nologin which effectively disables ssh login for the account.)
      For an existing user you would do:

      # usermod ftpuser -G ftp -s /sbin/nologin -d /home/ftpuser

  • 🐧 nixCraft Jan 2, 2010 @ 5:17

    You can define directory while creating UNIX/ Linux user account.

  • Matthew Aug 12, 2010 @ 17:26

    Using the pam file and virtual users with SSL/TLS, would i have to use the user_config_dir= option to set specifics for those users so they have seperate login directories, since those users aren’t in the centos users account, but in the separate pam database file?

  • sleepin Nov 4, 2011 @ 3:48

    Q:how to remove the ftp account?

  • John Dec 4, 2011 @ 6:23

    it wont let me upload anything, i am using filezilla, it says error 553 could not create file and 550 could not change directory

  • anon Oct 15, 2012 @ 19:21

    this is the usual ‘type it in’ and hope for the best.
    surely a gui os like suse should at least have a simple gui to add authenticated ftp users

  • Eugene Nov 21, 2012 @ 2:31

    Guys, note!!! /etc/shells MUST have /sbin/nologin in it, otherwise, you’ll get Login Failed

    • Eugene Nov 21, 2012 @ 2:59

      Sorry, NOT /sbin/nologin, but valid shell

  • Peter Alvin Jul 15, 2014 @ 21:38

    I get this when I try to log on:
    500 OOPS: cannot change directory:/home/pete

  • sahil Sep 5, 2014 @ 6:14

    hi i want to know on
    1. On a network how we can create a ftp server and group
    2.How we can allocate (provide) specific space for sftp server .

  • sahil Sep 5, 2014 @ 6:14

    hi i want to know on
    1. On a network how we can create a ftp server and group
    2.How we can allocate (provide) specific space for sftp server .

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum