Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 stackoverflow.com 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

1 Answer 1

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

 
discard

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.