FTP & SELinux: 500 OOPS: cannot change directory

If you've created a new user, and assigned it a home directory, you might run into the following error message when you're running SELinux in combination with FTP daemons (proftpd, vsftpd, ...): 500 OOPS: cannot change directory.

The message is thrown because SELinux is preventing the FTP daemon from reading user home directories.

You can overwrite this setting, by issuing the following command directly from the CLI.

/usr/sbin/setsebool -P ftp_home_dir=1

This will allow FTP access to a user home directory through SELinux.

Ps; don't replace ftp_home_dir with the home directory you're trying to access, it's a setting named "ftp_home_dir" that we're trying to alter.

Spread the word
If you liked the content of this article, please vote for it on the following websites - thanks.
  • Facebook
  • Twitter
  • del.icio.us
  • LinkedIn
  • DZone
  • Reddit
  • Digg
  • StumbleUpon
  • Sphinn
This entry was posted in linux and tagged , , . Bookmark the permalink.

2 Responses to FTP & SELinux: 500 OOPS: cannot change directory

  1. Chris says:

    Perfect! I saw the error in the log, but couldn’t quickly figure out how to enable FTP.
    Thanks!

  2. Jaime says:

    By doing this the ftp user is able to exit from its home directory… isn’t that unsafe?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">