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
ftpusers user_list vsftpd.conf vsftpd_conf_migrate.sh
[[email protected] 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
[[email protected] ~]# 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
selinxu=enforcing 改成 selinux=disabled
然后必须重启服务器
测试
登录用户为 test 密码为123456
测试成功!
原文:http://jiazuzhao.blog.51cto.com/1123655/1885492