linux 安装 ftp 服务

来源:互联网 发布:fifa online mac 编辑:程序博客网 时间:2024/05/21 13:57

可以使用yum命令直接安装ftp

 yum install vsftpd

修改下配置,

vim /etc/vsftpd/vsftpd.conf// 开头部分anonymous_enable=NO     // yes 改为 no  禁止匿名用户登录// 往下走chroot_local_user=YES  //原本是 # 注释了,去掉注释

重启vsftp

service vsftpd restart

建立用户

 useradd -d /home/www test       #增加用户test,并制定test用户的主目录为/home/www passwd test                     #为test设置密码 usermod -s /sbin/nologin test   #限定用户test不能telnet,只能ftp chmod o+w /home/www             #修改文件夹权限,否则无法上传文件(我是直接777了...)

最后,关闭防火墙测试一下,应该没问题了。

关于开启防火墙,设置端口
http://www.server110.com/linux/201311/3383.html

附:

usermod -s /sbin/bash test  //用户test恢复正常usermod -d /test test       //更改用户test的主目录为/test

参考:
http://www.cnblogs.com/yangjinjin/p/3158245.html
http://www.centoscn.com/CentosServer/ftp/2013/0730/816.html

0 0