FTP-2

作者: Tess鱼丸 | 来源:发表于2022-11-21 11:24 被阅读0次

    安装vsftpd

    
    [root@localhost ~]# rpm -q vsftp
    package vsftp is not installed
    
    [root@localhost ~]# yum -y install vsftpd
    Loaded plugins: fastestmirror, langpacks
    Loading mirror speeds from cached hostfile
     * base: ftp.sjtu.edu.cn
     * extras: ftp.sjtu.edu.cn
     * updates: ftp.sjtu.edu.cn
    Resolving Dependencies
    --> Running transaction check
    ---> Package vsftpd.x86_64 0:3.0.2-29.el7_9 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    =========================================================================================================
     Package               Arch                  Version                        Repository              Size
    =========================================================================================================
    Installing:
     vsftpd                x86_64                3.0.2-29.el7_9                 updates                173 k
    
    Transaction Summary
    =========================================================================================================
    Install  1 Package
    
    Total download size: 173 k
    Installed size: 353 k
    Downloading packages:
    vsftpd-3.0.2-29.el7_9.x86_64.rpm                                                  | 173 kB  00:00:02     
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Installing : vsftpd-3.0.2-29.el7_9.x86_64                                                          1/1 
      Verifying  : vsftpd-3.0.2-29.el7_9.x86_64                                                          1/1 
    
    Installed:
      vsftpd.x86_64 0:3.0.2-29.el7_9                                                                         
    
    Complete!
    [root@localhost ~]# 
    [root@localhost ~]# 
    

    启动vsftpd

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

    此时windows本机就可以登录上了。

    [root@localhost ~]# cd /var/ftp/
    [root@localhost ftp]# ls
    pub
    [root@localhost ftp]# 
    [root@localhost ftp]# ls 
    .bash_logout   .bashrc        .config/       pub/           
    .bash_profile  .cache/        .mozilla/      
    [root@localhost ftp]# 
    [root@localhost ftp]# mkdir ftpTest
    [root@localhost ftp]# 
    [root@localhost ftp]# ls
    ftpTest  pub
    [root@localhost ftp]# ll
    total 0
    drwxr-xr-x. 2 root root 6 Nov 21 17:38 ftpTest
    drwxr-xr-x. 2 root root 6 Jun  9  2021 pub
    [root@localhost ftp]# 
    [root@localhost ftp]# chmod 777 ftpTest/
    [root@localhost ftp]# ls
    ftpTest  pub
    [root@localhost ftp]# ll
    total 0
    drwxrwxrwx. 2 root root 6 Nov 21 17:38 ftpTest
    drwxr-xr-x. 2 root root 6 Jun  9  2021 pub
    [root@localhost ftp]# 
    [root@localhost ftp]# systemctl start vsftpd
    [root@localhost ftp]# 
    [root@localhost ftp]# cd /etc/vsftpd/
    [root@localhost vsftpd]# ls
    ftpusers  user_list  vsftpd.conf  vsftpd_conf_migrate.sh
    [root@localhost vsftpd]# 
    [root@localhost vsftpd]# cat vsftpd.conf |grep -v "#"
    anonymous_enable=YES
    local_enable=YES
    write_enable=YES
    local_umask=022
    dirmessage_enable=YES
    xferlog_enable=YES
    connect_from_port_20=YES
    xferlog_std_format=YES
    listen=NO
    listen_ipv6=YES
    
    pam_service_name=vsftpd
    userlist_enable=YES
    tcp_wrappers=YES
    [root@localhost vsftpd]# 
    
    [root@localhost vsftpd]# mv vsftpd.conf vsftpd.conf.bak
    [root@localhost vsftpd]# 
    [root@localhost vsftpd]# cat vsftpd.conf.bak |grep -v "#" >>vsftpd.conf
    [root@localhost vsftpd]# ls
    ftpusers  user_list  vsftpd.conf  vsftpd.conf.bak  vsftpd_conf_migrate.sh
    [root@localhost vsftpd]# vim vsftpd.conf
    anonymous_enable=YES
    local_enable=YES
    write_enable=YES
    local_umask=022
    dirmessage_enable=YES
    xferlog_enable=YES
    connect_from_port_20=YES
    xferlog_std_format=YES
    listen=NO
    listen_ipv6=YES
    
    pam_service_name=vsftpd
    userlist_enable=YES
    tcp_wrappers=YES
    
    ###运行匿名登录
    anonymous_enable=YES
    #再添加以下读写权限
    anon_upload_enable=YES
    anon_mkdir_write_enable=YES
    anon_other_write_enable=YES
    

    相关文章

      网友评论

          本文标题:FTP-2

          本文链接:https://www.haomeiwen.com/subject/xwigxdtx.html