How to add FTP Users on a Server

Discussion in 'Server Operation' started by simianstyle, Nov 15, 2006.

  1. simianstyle

    simianstyle New Member

    I recently just did a fresh install of Ubuntu 6.10 on a cheap $200 box. I'm using this as a home server to test on, and i didn't install Postfix, Courier, or ISPConfig on it. I was wondering how can i add users on proftpd with the proper privileges to read/write to the server via FTP access.

    I am relatively new to Linux so I apologize if this seems a little obvious. Any help is much appreciated.
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Just add a user with the useradd command to your system, e.g. like this:
    Code:
    useradd -d /home/exampleuser -m -g users -s /bin/bash exampleuser
    This creates a user exampleuser with the homedir /home/exampleuser and the shell /bin/bash (you can also use another shell like /bin/false (which means the user has no shell access which is good security-wise), but then you might have to add the shell to /etc/shells). Then run
    Code:
    passwd exampleuser
    to give that user a password. Next make sure you have
    Code:
    DefaultRoot ~
    in /etc/proftpd.conf. If you have to modify /etc/proftpd.conf, restart Proftpd. Afterwards, you can use an FTP client and login with the username exampleuser and his password. That user will be chrooted to his homedir /home/exampleuser.

    If you don't want to use system users, have a look at this tutorial: http://www.howtoforge.com/proftpd_mysql_virtual_hosting
    It uses virtual users which means all you have to do to create a new user is to add it to the MySQL database.
     

Share This Page