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

When I'm trying to connect to FTP server I get: "500 OOPS: cannot change directory:/home/$USER/public_html"

  • when I do echo $USER - I get proper username
  • seems like $USER isn't interpreted inside my /etc/vsftpd.conf
  • when I remove "local_root=/var/www/sites/$USER" I everything is smoothly working.

I'm running vsftpd 2.2.2 and Ubuntu 10.04.1 LTS Release: 10.04 Codename: lucid

share|improve this question
up vote 13 down vote accepted

What you need to use is a combo of user_config_dir and local_root. In the main config file /etc/vsftpd/vsftp.conf you have an entry like:


Inside that directory (/etc/vsftpd/users) you have a config file with the same name as the user ($USER in your case), and inside that file you have:


...where USER is the actual name (not literally USER or $USER).

share|improve this answer
Thank you this solved a problem I had. – Luis Alvarado Oct 29 '11 at 19:31

You must set user_sub_token:

share|improve this answer

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.