Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 installed vsftpd successfully, but whenever I connect to the server via Filezilla, I see the default folder is /root. How can I set up the default folder to be /var/www once I connect?

share|improve this question
up vote 1 down vote accepted

If you want to login as root and go straight to /var/www, then there's probably a Filezilla option for that (no idea what it is, I stopped voluntarily using FTP about 10 years ago).

What you should be doing instead, though, is learning how to administer your server properly. That includes things like not sticking web content into /var/www, and instead creating non-privileged users that own and manage the content for individual sites. Even if a server only hosts one site, it is far better that a regular user is the owner of the content, and my personal preference is for the site data to live in the user's home directory.

share|improve this answer

Because you are connecting as root and $HOME folder is /root.

You should create a new ftp user without login shell:

useradd -d /var/www -s /sbin/nologin <ftp_user>

(Remember to set chroot_local_user to YES to restrict ftp users to their home directory)

or setup virtual users.

share|improve this answer
could anyone leave a comment to let me know why you voted down my answer? – quanta Aug 12 '11 at 5:12

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.