Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

migrated from Jun 7 '12 at 10:17

This question came from our site for professional and enthusiast programmers.

But scp/sftp/rsync is much more secure than FTP. What is the problem with that? – glglgl Jun 6 '12 at 21:32
up vote 3 down vote accepted

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).

share|improve this answer
Thanks for the answer :) – Morten Hagh Jun 6 '12 at 13:40
@MortenHagh You're most welcome. Have a good day. – Rohan Durve - Decode141 Jun 6 '12 at 13:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.