Home  >  Q&A  >  body text

apache - vsftpd 提示 500 OOPS: cannot change directory

selinux

selinux 已经disabled

vsftpd

useradd xxx.com -d /var/virtual/xxx.com -g apache

登录vsftpd

提示 500 OOPS: cannot change directory:/var/virtual/xxx.com

网上说的那些都是关闭selinux,可我selinux已经完全关闭的。

[root@localhost vsftpd]# setsebool -P ftp_home_dir 1
setsebool:  SELinux is disabled.
[root@localhost vsftpd]#

整个过程

[root@localhost ~]# ls -la /var/virtual
total 12
drwxrwxr-x  3 root   root   4096 Sep  9 00:50 .
drwxr-xr-x 23 root   root   4096 Sep  8 23:54 ..
drwxrw----  5 apache apache 4096 Sep  9 00:50 xxx.com
[root@localhost ~]# ftp localhost
Trying ::1...
ftp: connect to address ::1Connection refused
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
220 (vsFTPd 3.0.2)
Name (localhost:root): xxx.com
331 Please specify the password.
Password:
500 OOPS: cannot change directory:/var/virtual/xxx.com
Login failed.
ftp> exit
[root@localhost ~]# grep xxx.com /etc/passwd
xxx.com:x:1000:48::/var/virtual/xxx.com:/bin/bash
[root@localhost ~]#

滿天的星座滿天的星座2733 days ago830

reply all(2)I'll reply

  • 为情所困

    为情所困2017-04-25 09:03:12

    What are the permissions of your FTP account on this directory?

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-04-25 09:03:12

    For situations where selinux is turned off and directory permissions are OK, it is recommended to check whether the machine logged in via ftp can ssh to the ftp server normally. vsftp uses ssh as the transmission encryption protocol, which may also be related to this.

    reply
    0
  • Cancelreply