centos yum安装ftp 及解决vsftp错误500 OOPS: cannot change directory:/home/**
centos yum安装ftp 及解决vsftp错误500 OOPS: cannot changedirectory:/home/** 1.查看服务器有没有安装ftp包 rpm -qa |grep vsftp 2.yum 安装 yum -y install vsftpd 3.启动vsftp的服务 service vsftpd start 4.关闭防火墙 service iptables stop 5.测试匿名访问 修改配置文件 vsftpd.conf [iyunv@localhost vsftpd]# ls ftpusers user_list vsftpd.conf vsftpd_conf_migrate.sh [iyunv@localhost vsftpd]#vi vsftpd.conf 把配置文件里面的 # Uncomment this to allow the anonymous FTP user to uploadfiles. This only # has an effect if the above global write enable is activated.Also, you will # obviously need to create a directory writable by the FTP user. #anon_upload_enable=YES # # Uncomment this if you want the anonymous FTP user to be ableto create # new directories. #anon_mkdir_write_enable=YES #号给掉 然后保存重启服务 6.添加用户测试 useradd -m -d /home/test -s/bin/sh -g root test passwd test 123456 useradd [-u uid | -g group] | -d dir | -s shell | -c comment | -m [-k skel_dir] ] login
说明:
u 指定用户ID号
g 制定所在组
d 指定用户目录
s 制定用户SHELL
c 用户的注释
m 建立用户目录
login 用户的登录名 useradd 参数有必要看一下 重启服务测试登录报错 500 OOPS: cannot change directory:/home/test 修改/home/ 权限 chomd 777 /home/ 依旧是此错误 查看资料修改selinux [iyunv@localhost ~]# cat /etc/selinux/config # This file controls the state of SELinux on thesystem. # 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. SELINUXTYPE=targeted [iyunv@localhost ~]# selinxu=enforcing 改成 selinux=disabled
然后必须重启服务器
|