最近需要使用 ftp 工具,所以借此机会来进行整理以下具体的内容:

具体什么是ftp, ftp 能干什么?

请参考:

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/s1-ftp

http://cn.linux.vbird.org/linux_server/0410vsftpd.php

重点理解:主动联机 与 被动联机 两种模式中,端口的选择。

主动连接

active mode

       Active mode is the original method used by the FTP protocol for transferring data to the client application. When an active-mode data transfer is initiated by the FTP client, the server opens a connection from port 20 on the server to the IP address and a random, unprivileged port (greater than 1024) specified by the client. This arrangement means that the client machine must be allowed to accept connections over any port above 1024. With the growth of insecure networks, such as the Internet, the use of firewalls for protecting client machines is now prevalent. Because these client-side firewalls often deny incoming connections from active-mode FTP servers, passive mode was devised.

被动连接

passive mode

       Passive mode, like active mode, is initiated by the FTP client application. When requesting data from the server, the FTP client indicates it wants to access the data in passive mode and the server provides the IP address and a random, unprivileged port (greater than 1024) on the server. The client then connects to that port on the server to download the requested information.
       While passive mode does resolve issues for client-side firewall interference with data connections, it can complicate administration of the server-side firewall. You can reduce the number of open ports on a server by limiting the range of unprivileged ports on the FTP server. This also simplifies the process of configuring firewall rules for the server.
 
安装vsftpd 软件:
➜  Desktop yum search vsftpd
Last metadata expiration check: days, :: ago on Tue Jun :: PM CST.
================================================== Name Exactly Matched: vsftpd ==================================================
vsftpd.x86_64 : Very Secure Ftp Daemon

vsftpd 全称为:  Very Secure Ftp Daemon

vsftpd 配置文件:我们可以使用 man 5 vsftpd.conf 命令,来查找vsftpd 的配置说明。

FTP 连接与命令:

1. 登录

[root@dhcp-- ~]# ftp localhost
Trying ::...
Connected to localhost (::).
Welcome to blah FTP service.
Name (localhost:root): yaowen
Please specify the password.
Password:
Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
Entering Extended Passive Mode (||||)
Here comes the directory listing.
drwxr-xr-x Jun : Desktop
drwxr-xr-x Jun Documents
drwxr-xr-x May : Downloads
drwxrwxr-x Jun : ISO
drwxr-xr-x Jun : NFS4
drwxr-xr-x Jun Pictures
drwxr-xr-x Jun Public
drwxr-xr-x Jun Templates
drwxr-xr-x Jun Videos
Directory send OK.
ftp>

2. 如果没有ftp 命令,则进行安装

[root@yaowenxu Desktop]# yum install ftp

3. ftp 支持的命令

使用 help 或者 ? 来进行查看当前服务所支持的命令

ftp> ?
Commands may be abbreviated. Commands are: ! debug mdir sendport site
$ dir mget put size
account disconnect mkdir pwd status
append exit mls quit struct
ascii form mode quote system
bell get modtime recv sunique
binary glob mput reget tenex
bye hash newer rstatus tick
case help nmap rhelp trace
cd idle nlist rename type
cdup image ntrans reset user
chmod lcd open restart umask
close ls prompt rmdir verbose
cr macdef passive runique ?
delete mdelete proxy send

我们可以使用 ftp 利用交互式的方式来进行与 ftpd 服务器来进行交互。

我们 可以使用 get 下载文件,使用 put 上传文件;

使用 lcd 确定本地文件夹,使用pwd 确定服务器文件夹。

保持更新,转载请注明出处。

FTP 命令的使用的更多相关文章

  1. linux系统ftp命令

    先来一段简单的ftp 下载脚本 ftp -i -n<<EOF open 14.2.33.211 user etl etl cd /etlfile/ftpfile lcd /etlfile/ ...

  2. Linux服务器ftp命令找不到

    ftp commond not find 先用命令rpm -q vsftpd检查是否安装了ftp服务器 若显示vsftpd-2.2.2-11.el6_4.1.x86_64这样的信息,说明FTP服务器已 ...

  3. FTP命令

    linux下常用FTP命令 1. 连接ftp服务器   1. 连接ftp服务器 格式:ftp [hostname| ip-address]a)在linux命令行下输入: ftp 192.168.1.1 ...

  4. windows下ftp命令大全

    FTP Server: home4u.at.china.com User: yepanghuang Password: abc123 打开Windows的开始菜单,执行“运行”命令,在对话框中输入ft ...

  5. 通过FTP命令上传下载

      用命令如何把自己电脑上的文件上传到被入侵的电脑上呢.方法有很多.用ftp是个不错的选择.方法如下 echo open 你的ftpip >ftp.txt echo user >>f ...

  6. linux ftp命令(转)

    此命令需要安装ftp, yum install ftp 1. 连接ftp服务器 格式:ftp [hostname| ip-address]a)在linux命令行下输入: ftp 192.168.1.1 ...

  7. 详述Linux ftp命令的使用方法

    转自:http://os.51cto.com/art/201003/186325.htm ftp服务器在网上较为常见,Linux ftp命令的功能是用命令的方式来控制在本地机和远程机之间传送文件,这里 ...

  8. 利用windows系统ftp命令编写的BAT文件上传[转]

    利用windows系统ftp命令编写的BAT文件上传[转] 利用windows系统ftp命令编写的BAT文件上传[转] 在开发中往往需要将本地的程序上传到服务器,而且用惯了linux命令的人来说.在w ...

  9. ftp命令和scp命令

    ftp命令: 服务器有安装ftp Server,另外一台linux可以使用ftp的client程序来进行文件的拷贝读取和下载. 1. 连接ftp服务器  格式:ftp [hostname| ip-ad ...

  10. FTP命令详解

    FTP的命令行格式为:ftp -v -d -i -n -g [主机IP或者主机名],其中 -v显示远程服务器的所有响应信息: -n限制ftp的自动登录,即不使用: .n etrc文件: -d使用调试方 ...

随机推荐

  1. Supervisod的使用

    原文链接:http://blog.csdn.net/xyang81/article/details/51555473 Supervisor(http://supervisord.org/)是用Pyth ...

  2. INTEST/EXTEST SCAN

    INTEST scan指的是对IP 内部的scan cell的扫描测试,针对IP内部的flip-flop进行shift/capture的操作.和INTEST SCAN 对应的就是EXTEST SCAN ...

  3. linux下md5sum用法 (查看文件或字符串的md5值)

    MD5算法常常被用来验证网络文件传输的完整性,防止文件被人篡改.MD5 全称是报文摘要算法(Message-Digest Algorithm 5),此算法对任意长度的信息逐位进行计算,产生一个二进制长 ...

  4. 【IT笔试面试题整理】字符串转数组+数组转字符串

    [试题描述]定义一个函数,字符串转数组数组转字符串 [参考代码] public static int strToInt(String str) { int i = 0, num = 0; char[] ...

  5. SSM整合Shiro 身份验证及密码加密简单实现

    1.导入maven的相关依赖 <!-- shiro --> <dependency> <groupId>org.apache.shiro</groupId&g ...

  6. Spring基础(8) : properties配置文件

    <context:property-placeholder location="p.properties"/> <bean id="p" cl ...

  7. 【4】 .net MVC使用Session验证用户登录

    用最简单的Session方式记录用户登录状态 1.添加DefaultController控制器,重写OnActionExecuting方法,每次访问控制器前触发 public class Defaul ...

  8. Codeforces834A

    A. The Useless Toy time limit per test:1 second memory limit per test:256 megabytes input:standard i ...

  9. mysql小试题3

    查询结果:

  10. Angular4.x 自定义搜索组件

    Angular4 随笔(三)  ——自定义搜索组件 1.简介 本组件主要是实现了搜索功能,主要是通过父子组件传值实现. 基本逻辑: 1.创建一个搜索组件,如:ng g component  searc ...