1

Error:

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

visitor:x:1000:1001::/home/visitor:/sbin/nologin

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

vsftpd.conf

local_enable=YES
write_enable=YES
chroot_local_user=YES
allow_writeable_chroot=YES
pasv_enable=Yes
pasv_min_port=10000
pasv_max_port=10100

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

"XX.XXX.XX.XXX"

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
2

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.

0

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.

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.