zoukankan      html  css  js  c++  java
  • ftp服务

    ftp有两个端口(21是控制端口,20数据端口),有两种工作模式:1.端口模式/主动模式   2.被动模式

    客户端决定服务器

    telnet测试

    1.先安装 yum install telnet

    [root@slave1 ~]# telnet 192.168.88.101 21
    Trying 192.168.88.101...
    Connected to 192.168.88.101.
    Escape character is '^]'.
    220 (vsFTPd 3.0.2)
    user ftp
    331 Please specify the password.
    pass ftp
    230 Login successful.
    PORT 192,168,88,102,48,57     # 256*48+57=12345
    200 PORT command successful. Consider using PASV.
    list
    150 Here comes the directory listing.
    226 Directory send OK.
    quit
    221 Goodbye.
    Connection closed by foreign host.

     2. 安装 yum install nc

    [root@slave1 ~]# nc -l 192.168.88.102 12345
    -rw-r--r--    1 0        0               0 Jul 15 02:37 1.txt
    -rw-r--r--    1 0        0               0 Jul 15 02:37 2.txt
    drwxr-xr-x    2 0        0               6 Jul 15 02:35 aa
    drwxr-xr-x    2 0        0               6 Oct 30  2018 pub
    

    二.匿名服务

    1.更改配置文件

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

    anon_upload_enable=YES    允许匿名用户上传文件
    #
    # Uncomment this if you want the anonymous FTP user to be able to create
    # new directories.
    #anon_mkdir_write_enable=YES
    

    2.给目录加权限

    [root@mysqlb ftp]# mkdir /var/ftp/panda
    [root@mysqlb ftp]# ls
    1.txt  2.txt  aa  panda  pub
    [root@mysqlb ftp]# chmod 777 panda
    [root@mysqlb ftp]# ll -d panda
    drwxrwxrwx. 2 root root 6 7月  15 18:17 panda
    

    3.重启服务

    [root@mysqlb ~]# systemctl restart vsftpd

    4.用另一个用户登录ftp

    [root@slave1 ~]# lftp 192.168.88.101
    lftp 192.168.88.101:~> ls
    -rw-r--r--    1 0        0               0 Jul 15 02:37 1.txt
    -rw-r--r--    1 0        0               0 Jul 15 02:37 2.txt
    drwxr-xr-x    2 0        0               6 Jul 15 02:35 aa
    drwxrwxrwx    2 0        0               6 Jul 15 10:17 panda
    drwxr-xr-x    2 0        0               6 Oct 30  2018 pub
    lftp 192.168.88.101:/> cd panda
    lftp 192.168.88.101:/panda> put /etc/passwd
    1027 bytes transferred
    lftp 192.168.88.101:/panda> ls
    -rw-------    1 14       50           1027 Jul 15 10:18 passwd
    lftp 192.168.88.101:/panda> quit
    

      

     

  • 相关阅读:
    贪心:字典树openjudge1799-最短前缀
    BFS:noi6044鸣人与佐助
    广搜:codevs-3344(初步bfs)
    2016noip感想(普及组)
    NOI-Openjudge-8462-大盗阿福
    20155326 第12周课堂实践总结(二)String类和Arrays类的学习
    20155326 第12周课堂实践总结(一)
    20155326 实验三 敏捷开发与XP实践
    20155326 2016-2017-2 《Java程序设计》第十周学习总结
    2016-2017-2 20155326实验二《Java面向对象程序设计》实验报告
  • 原文地址:https://www.cnblogs.com/MR-ws/p/11189848.html
Copyright © 2011-2022 走看看