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 ~]#
你的FTP帳號對該目錄的權限呢?
對於selinux為關閉狀態,目錄權限沒問題的狀況,建議檢查ftp登入的機器是否可以正常ssh到ftp server。 vsftp使用了ssh作為傳輸加密協議,可能也跟這個有關係。