FTP & SELinux: 500 OOPS: cannot change directory

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, February 23, 2009

Follow me on Twitter as @mattiasgeniar

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.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.