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'm having trouble configuring proftpd to allow a system user access to /var/www/ on a centos box.


ServerName                      "ProFTPD server"
ServerIdent                     on "FTP Server ready."
ServerAdmin                     root@localhost
ServerType                      standalone
DefaultServer                   on
VRootEngine                     on
#DefaultRoot                    ~ !adm
DefaultRoot                     /var/www/
VRootAlias                      /etc/security/pam_env.conf etc/security/pam_env.conf
AuthPAMConfig                   proftpd
AuthOrder                       mod_auth_pam.c* mod_auth_unix.c
#PersistentPasswd               off
UseReverseDNS                   off
User                            nobody
Group                           nobody
MaxInstances                    20
UseSendfile                     off
LogFormat                       default "%h %l %u %t \"%r\" %s %b"
LogFormat                       auth    "%v [%P] %h %t \"%r\" %s"

  Umask                         022
  AllowOverwrite                yes

<Limit LOGIN>
AllowUser ftpuser

I've created a system user 'ftpuser' with thier home dir as /var/www/ and a valid shell. I can ssh in as this user and view the correct directories etc.

However when I try to use an ftp client to connect or even connect to localhost from a shell I get errors:

Status: Connecting to
Status: Connection established, waiting for welcome message...
Response:   220 FTP Server ready.
Command:    USER ftpuser
Response:   331 Password required for ftpuser
Command:    PASS *******
Response:   230 User ftpuser logged in
Command:    OPTS UTF8 ON
Response:   200 UTF8 set to on
Status: Connected
Status: Retrieving directory listing...
Command:    PWD
Response:   257 "/" is the current directory
Command:    TYPE I
Response:   200 Type set to I
Command:    PASV
Response:   227 Entering Passive Mode (10,0,10,10,184,18).
Command:    MLSD
Response:   550 /: Invalid argument
Error:  Failed to retrieve directory listing


telnet localhost 21
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 FTP Server ready.
user ftpuser
331 Password required for ftpuser
230 User ftpuser logged in
425 Unable to build data connection: Invalid argument
550 /: Invalid argument

Does anyone know what is happening here & how to fix it?

share|improve this question
up vote 5 down vote accepted

Check that SElinux isn't causing you problems

setenforce 0

If this fixes your problem then turn SELinux back on (setenforce 1) and then try setting the ftp_home_dir boolean

setsebool -P ftp_home_dir on

which will allow the ftp daemon to access user home directories.

share|improve this answer
Thanks - this was exactly the issue. – Sean Kimball Dec 9 '13 at 22:31

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.