linux之ftp搭建

一、写在开头

  ftp 是File Transfer Protocol(文件传输协议)的英文简称,而中文简称为“文传协议”。用于Internet上的控制文件的双向传输。同时,它也是一个应用程序(Application)。

  ps:简单说,搭建一个文件服务器。

  我是在一个阿里云服务器上创建的Centos 7.2 里搭建ftp,一切以此为基础开始讨论

二、安装配置

#检查有没有安装过vsftpd
rpm -qa |grep vsftpd

#安装vsftpd yum -y install vsftpd #指定开机启动 chkconfig vsftpd on

  

找到ftp配置文件/etc/vsftpd/vsftpd.conf,编辑它

#限定所有用户只能见到自己的主目录
chroot_list_enable=YES
#允许chroot_list_file配置的用户作为例外(可以见到所有目录)
chroot_local_user=YES
#指定例外用户配置文件
chroot_list_file=/etc/vsftpd/chroot_list

ps:

  ftp的配置文件主要有三个,位于/etc/vsftpd/目录下,分别是:

  ftpusers 该文件用来指定那些用户不能访问ftp服务器。

  user_list 该文件用来指示的默认账户在默认情况下也不能访问ftp

  vsftpd.conf vsftpd的主配置文件

添加用户

#新增一个test用户,并指定其访问根路径为/var/ftp/test,且不允许用户使用shell登录服务器
#这里相当于在添加linux服务器访问的用户,不指定-s /sbin/nologin,不安全
useradd test -d /var/ftp/test -s /sbin/nologin
#指定用户密码
passwd test

  

三、测试方法

  安装一个FileZilla,用test的账号密码连到服务器上看看

四、错误调试

  阿里云端口限制去除

  https://www.yudouyudou.com/jiaochengheji/wangzhanjianshe/1151.html

  FileZilla无法连接到服务器,不安全的服务器,不支持 FTP over TLS?

  https://blog.csdn.net/iastro/article/details/31729859

参考资料

  用户添加

  https://blog.csdn.net/u014691453/article/details/62424605

  https://blog.csdn.net/xufei512/article/details/52037497

   安装过程

  https://blog.csdn.net/zgy621101/article/details/78902020

  https://www.cnblogs.com/huixuexidezhu/p/6560031.html

  https://www.cnblogs.com/Confession/p/6813227.html

  权限控制

  https://blog.csdn.net/bluishglc/article/details/42398811

猜你喜欢

转载自www.cnblogs.com/chendeming/p/9219165.html