zoukankan      html  css  js  c++  java
  • CentOS7下安装FTP服务

    1、安装vsftp

    1.1、安装vsftp,测试安装的vsftpd的版本是:vsftpd.x86_64 0:3.0.2-11.el7_2

    yum -y install vsftpd

    1.2、修改配置文件

    vi /etc/vsftpd/vsftpd.conf

        保证下面3项为YES

        anonymous_enable=YES

        anon_upload_enable=YES

        anon_mkdir_write_enable=YES

    1.3、设置vsftpd开机启动

    systemctl enable vsftpd.service

    1.4、启动并查看vsftpd服务状态,systemctl启动服务成功不会有任何提示,绿色的active表示服务正在运行

    systemctl start vsftpd.service
    systemctl status vsftpd.service

    2、本地验证ftp是否可以正常访问

    2.1、安装ftp

    yum -y install ftp

    2.2、使用anonymous登陆,无需密码

    ftp localhost

    220表示服务正常,可以登陆;230表示登陆成功。

    2.3、查看FTP服务器文件夹信息

    3、  外部证ftp是否可以正常访问

    3.1、关闭防火墙(也可以设置防火墙规则,得再百度了)

    systemctl stop firewalld.service

      为防止机器重启后防火墙服务重新开启,可将防火墙服务永久关闭。

    systemctl disable firewalld.service

    3.2、在window上输入ftp://IP地址,可看到ftp下的目录(pub为系统预设的)

    4、文件读写。

         到上面为止,我们发现ftp目录下并不能读写文件,这是由文件夹权限和selinux引起的。

    4.1、设置文件夹权限,将pub文件夹的权限设置为777

    chmod 777 -R /var/ftp/pub

    4.1、关闭selinux服务

    vi /etc/selinux/config

        将SELINUX=enforcing改为:SELINUX=disabled

    4.3、系统重启,让配置生效

    shutdown -r now

    4.4、上传文件

    至此,ftp完全安装完成,若需为FTP配置用户权限,可自行百度。

  • 相关阅读:
    CSS中position小解
    position
    mac默认安装postgresql, 如何让postgresql可以远程访问
    The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0.
    active admin gem error
    psql 无法添加超级用户
    ubuntu 15.04 安装Balsamiq Mockups 3
    Rails html 写public里图片的路径
    rails c 历史命令
    undefined local variable or method `per' for []:ActiveRecord::Relation
  • 原文地址:https://www.cnblogs.com/lxwphp/p/8930753.html
Copyright © 2011-2022 走看看