3

I want to create an FTP account on my Ubuntu server that amongst other things, runs as a LAN webserver.

Should I set the FTP user's home directory to /var/www/, or should I set it differently?

I ask because I want it to be easier to upload to this default directory instead of doing:

scp XXX ubuntu@ubuntu-server:/var/www/

every time.

1
  • But scp/sftp/rsync is much more secure than FTP. What is the problem with that?
    – glglgl
    Jun 6, 2012 at 21:32

1 Answer 1

4

You should be able to add a FTP user via this command:

sudo useradd userftp -p your_password -d /home/FTP-shared -s /bin/false

Wherein, userftp is the username, your_password is the password, and /home/FTP-Shared is the path.

I personally use this in proftpd, but I'm pretty sure the command should be universal.

Note that this user has been created only for FTP access, and as a result does not need a valid shell (making it slightly more secure) hence the "bin/false".

So basically for your case, just create the user and set its home directory to /var/www. However, remember to first chown and chmod the directory appropriately so that the new user may access it (be sure to add him to the appropriate group, etc).

1
  • @MortenHagh You're most welcome. Have a good day.
    – Rohan Durve - Decode141
    Jun 6, 2012 at 13:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .