当前位置 博文首页 > m0_53521757的博客:Linux(CentOS7)之FTP服务器设置

    m0_53521757的博客:Linux(CentOS7)之FTP服务器设置

    作者:[db:作者] 时间:2021-07-15 18:57

    FTP服务器设置-----匿名访问

    FTP:文件传输协议
    匿名访问模式:
    FTP匿名访问模式是比较不安全的服务模式,尤其在真实的工作
    环境中千万不要存放敏感的数据,以免泄露。
    vsftpd程序默认已经允许匿名访问模式,我们要做的就是开启
    匿名用户的上传和写入权限,在配置文件/etc/vsftpd/vsftpd.conf
    写入下面的参数:

    参数作用
    anonymous_ enable=YES允许匿名访问模式

    实验环境

    主机类型操作系统IP地址
    服务端CentOS7192.168.11.38
    客户端CentOS7 / Windows10------

    1.安装vsftpd服务程序包

    [root@localhost ~]# yum -y install vsftpd
    

    在这里插入图片描述
    2.编辑配置文件,添加内容

    [root@localhost ~]# vim /etc/vsftpd/vsftpd.conf 
    

    anon umask=022
    anon_ upload_ enable=YES
    anon_ mkdir write_ enable=YES
    anon_ other write_ enable=YES
    在这里插入图片描述

    3.启动服务器

    [root@localhost ~]# systemctl start vsftpd
    [root@localhost ~]# systemctl enable vsftpd
    

    在这里插入图片描述
    4.关闭防火墙

    [root@localhost ~]# systemctl stop firewalld.service
    

    5.关闭SELinux

    [root@localhost ~]# setenforce 0
    

    6.客户机( windows )登录FTP服务
    匿名访问模式的FTP根目录为/var/ftp
    可以先在服务端的/var/ftp/目录下写入一些内容

    [root@localhost ~]# echo CSDN >> /var/ftp/test.txt
    

    在这里插入图片描述
    在浏览器中输入ftp://192.168.11.38
    在这里插入图片描述
    同时可以下载test.txt 这个文件,查看文件的内容
    在这里插入图片描述
    7.客户机( Linux系统)登录FTP服务
    匿名访问模式的FTP根目录为/var/ftp. ftp命令用于使用FTP服务, 格式为:
    ftp [参数] [FTP主机]
    (1)安装ftp客户端

    [root@localhost ~]# yum -y install ftp
    

    在这里插入图片描述
    (2)访问ftp服务器

    [root@localhost ~]# ftp 192.168.11.38
    

    在这里插入图片描述

    今天的分享就到这里,大家有什么问题可以直接私信或者评论,博主肯定会回复的。希望大家指出我的不足之处,我们一起努力。创作不易,希望大家给个赞。

    cs