selinux 已经disabled
useradd xxx.com -d /var/virtual/xxx.com -g apache
提示 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 ~]#
What are the permissions of your FTP account on this directory?
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.