安裝vsftpd服務後,客戶端登錄ftp報錯:
ftp> open 127.0.0.1 Connected to 127.0.0.1 (127.0.0.1). 220 (vsFTPd 2.2.2) Name (127.0.0.1:wander): ftpuser 331 Please specify the password. Password: 500 OOPS: cannot change directory:/home/ftpuser Login failed.
原因是系統沒有關閉selinux
查看selinux狀態:
[wander@localhost ~]$ /usr/sbin/sestatus -v SELinux status: disabled //禁用selinux [wander@localhost ~]$ getenforce Disabled //禁用selinux [wander@localhost .ssh]$ getenforce Enforcing //啓動
關閉selinux方法:
#setenforce 0 #設置SELinux 成爲permissive模式 #setenforce 1 設置SELinux 成爲enforcing模式
第二種方法:
#vim /etc/selinux/config 編輯文件 # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=enforcing # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection.
將SELINUX=enforceing 改爲 SELINUX=disabled 重啓機器就ok了