Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

centOS7.0 搭建FTP服务器 #1

Open
ZYuMing opened this issue Mar 1, 2017 · 0 comments
Open

centOS7.0 搭建FTP服务器 #1

ZYuMing opened this issue Mar 1, 2017 · 0 comments
Labels

Comments

@ZYuMing
Copy link
Owner

ZYuMing commented Mar 1, 2017

前言

  为了做毕业设计,特地去买了个阿里云的服务器。一开始贪方便选择了Windows Server 2008操作系统,毕竟用惯了windows的界面操作,用了一周后发现系统老是出现各种各样的问题(= =)就换成了centOS系统。换了系统,第一件麻烦事就是如何搭建ftp服务器来上传项目文件和配合sublimeText里面的SFTP插件进行开发。

安装vsftp:

yum install vsftpd -y


编辑ftp配置文件:

文件所在位置 : /etc/vsftpd/vsftpd.conf

开启anonymous_enable

anonymous_enable=NO
#anonymous_enable=YES
chroot_local_user=YES

去掉前面的注释(不受限制的用户列表)

#chroot_list_enable=YES
#chroot_list_file=/etc/vsftpd/chroot_list

加上这行解决了无法登陆的问题

allow_writeable_chroot=YES

修改FTP的Selinux设置

setsebool -P ftp_home_dir=1
sersebool -P allow_ftpd_full_access=1


防火墙的设置

关闭关闭防火墙

service iptables stop

防火墙配置

iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -p tcp --dport 20 -j ACCEPT

在/etc/sysconfig/system-firewall-config中添加

--service=ftp


建立FTP账户

建立账号

useradd -d /path/you/want -s /sbin/nologin ftpadmin

修改密码

passwd ftpadmin

设置账户权限

chown -R ftpadmin.ftpadmin /path/you/set


启动/重新启动FTP

service vsftpd start
service vsftpd restart

@ZYuMing ZYuMing added the Linux label Mar 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant