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
    

      

     

  • 相关阅读:
    我的友情链接
    我的友情链接
    BuChain 介绍:视屏讲解
    2019年5月数据库流行度排行:老骥伏枥与青壮图强
    五一4天就背这些Python面试题了,Python面试题No12
    钱包:BUMO 小布口袋 APP 用户手册
    工具箱:BUMO 工具应用场景示例
    工具箱:BUMO 密钥对生成器用户手册
    开发指南:BUMO 智能合约 Java 开发指南
    钱包:BOMO 轻钱包用户手册
  • 原文地址:https://www.cnblogs.com/MR-ws/p/11189848.html
Copyright © 2011-2022 走看看