Response:   500 OOPS: cannot change directory:/home/visitor
Error:  Critical error: Could not connect to server

The user is visitor, the group is ftpusersonlygroup

grep visitor /etc/passwd


chown visitor:ftpusersonlygroup /home/visitor
chmod 777 /home/visitor
chmod -R ugo+rwx /home/visitor

Folder permissions /home/visitor

total 12K`

drwxrwxrwx  3 visitor ftpusersonlygroup  69 Oct  3 20:10 .
drwx------. 3 root    root               20 Oct  3 20:04 ..
-rwxrwxrwx  1 visitor visitor            18 Aug  2 16:00 .bash_logout
-rwxrwxrwx  1 visitor visitor           193 Aug  2 16:00 .bash_profile
-rwxrwxrwx  1 visitor visitor           231 Aug  2 16:00 .bashrc
drwxrwxrwx  2 visitor ftpusersonlygroup   6 Oct  3 20:19 www



SFTP works but FTP doesn't, no firewall as shown by test below 21/tcp open ftp vsftpd 3.0.2

FTP logs

Mon Oct 3 21:41:46 2016 [pid 26091] CONNECT: Client "XX.XXX.XX.XXX" 
Mon Oct 3 21:41:46 2016 [pid 26090] [visitor] OK LOGIN: Client


groups visitor user is part 0f

visitor : visitor ftpusersonlygroup

SELinux is disabled

getenforce Disabled

Any other ideas?

  • does it help if /home has 755 permissions rather than 700? – gogoud Oct 4 '16 at 21:35
  • Just wanted to say, thank you. This was it, this worked, thank you so much – l33tcodes Oct 5 '16 at 7:01

Set the parent directory to your user's home directory (/home in this case) to 755 permissions rather than 700 - the vsftpd user (visitor in this case) needs to be able to navigate through this directory too.

| improve this answer | |

Here's how I solved this problem in my case:

When I did this:

cd /var/www/vhosts/
usermod -d example.com usernameexample

I got the error:

500 OOPS: can not change directory

Then when I did this:

usermod -d /var/www/vhosts/example.com usernameexample

the problem resolved and I did not get the error anymore.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.