defeating vsftp error “500 OOPS: cannot change directory:/some/directory”

There’s lots of recommendations floating around the net for this, but try the following first:

Make sure that the user and group permissions for the account and the home directory match. For example, if you are logging in as:


then make sure that the home directory defined for “account” is at least readable and executable by user 521 and group 500.

I posted about this previously but this time I also ran into directory permissions. Ugh.

1 Star2 Stars3 Stars4 Stars5 Stars (7 votes, average: 4.29 out of 5)

38 Responses to “defeating vsftp error “500 OOPS: cannot change directory:/some/directory””

  1. Jaime M. Says:

    Hi! that error is generate for Selinux plz do the following actions:

    [root@sun02 vsftpd]# getenforce
    [root@sun02 vsftpd]# getsebool -a | grep ftp
    allow_ftpd_anon_write –> off
    allow_ftpd_full_access –> off
    allow_ftpd_use_cifs –> off
    allow_ftpd_use_nfs –> off
    allow_tftp_anon_write –> off
    ftp_home_dir –> on (change that to on in ur case this option is off)
    ftpd_disable_trans –> off
    ftpd_is_daemon –> on
    httpd_enable_ftp_server –> off
    tftpd_disable_trans –> off
    [root@sun02 vsftpd]# setseboll -P ftp_home_dir on

    This is all that u want to need.

    Good Luck!

  2. Matt A Says:

    Jaime –

    That totally worked for me, thank you so much. BTW, there is a typo in your last line, it should be:

    > setsebool -P ftp_home_dir on

    – Matt

  3. defeating vsftp error “500 OOPS: cannot change directory user_home” « 0960 Says:

    […] Original WebPage:… […]

  4. Nico Says:

    It worked

  5. Alex Says:

    Been looking for this for quite a while. Didn’t want to disable SELINUX

  6. surendra Says:

    thaks so much

  7. joe Says:

    Thanks for the useful tips.It was very helpful

  8. dave Says:

    This worked well. Thank you.

  9. Armando Landois Says:

    It Worked. Thanks

  10. okabi Says:

    that OK! thanks!

  11. ashwani Says:

    thanx alot for help

  12. Maple Leafs Says:

    Thank you! worked like a charm

  13. Iain Says:

    Awesome! Been beating my head trying to figure out why no ftp server would work

  14. Era Says:

    It is work
    Many Thnaks

  15. kman Says:

    thanks it worked

  16. Ashok Says:

    it is working fine

    thank you… 🙂

  17. srinivas Says:

    it worked but not secured……it leads to path traversal..
    ftp user able to see all sys files like /etc /var /boot everything ..
    “using Up to higher level directory”

  18. Siva Says:

    Thanks, it worked for me

  19. zibi Says:

    Thanks !

  20. Naren Says:

    Great !!!!!!!!!!!!
    Its working for me too……

  21. Bird2010 Says:


    Get the latest version of vsftpd direct from the author:

    I had lots of problems because the latest version of Linux Mint 14 was using an old version of vsftpd. I read the Software Manager page carefully for vsftpd and I noticed the author’s website link. I downloaded it and I am happy now!

  22. Carlos Says:


    On Jaime’s reply there is a typo:

    “setseboll” must be “setsebool”

  23. Eric Says:

    It works! Thanks!

  24. Elex Says:

    Thanks for this solution.

  25. Deepak Mahajan Says:

    I have Fedora 13, Directory listing started with command – setsebool -P ftp_home_dir on but it was not allowing to write files in /var/www/html so I have to set
    setsebool -P allow_ftpd_full_access on

    After this writing files permission started.

    Is it right way to do this.

  26. Statler Waldorf Says:

    Four years later this link is still relevant.  Saved my bacon.

  27. Matthieu Says:

    And don't forget that the parent directory ALSO must have excute rights for the user connected to your FTP server. You can do it by applying chmod o+x /parentdir/ftp or by using groups if you care about everybody able to traverse this parent dir.

  28. Nik Says:

    Still relevant!! Thanks!

  29. MikeCa Says:

    Thanks that was great and fixed the problem!

  30. Kamal Sharma Says:

    Thank you very much !

  31. jobaca Says:

    This worked, understanding selinux is useful…

  32. kenny Says:

    It worked. Thanks a million

  33. Chris Says:

    … since almost a couple of years … it works again and again …

    Thanks a lot !!

  34. DD Says:

    Yup, and still relevant for Fedora22.
    After following the usual vsftpd setup my user with the default home directory worked fine, but another user I had setup with a different directory failed. All permissions to directory were fine because when I ssh in as them everything works.
    vsftpd however gave me 500 OOPS: cannot change directory, but after setting the following all is now fine…
    setsebool -P ftp_home_dir on
    setsebool -P ftpd_full_access on

  35. Sadiki Says:

    Thanks alot.

  36. Sreedhar Says:

    Thanks!!!!!! 🙂

  37. Sreedhar Says:

    Correct command from

    setseboll -P ftp_home_dir on
    setsebool -P ftp_home_dir on

  38. Cristian Says:

    Thanks for the tip!

Leave a Reply