FTP服务

一、实验的目的:
学会FTP服务器的配置和实验,了解文本模式与二进制模式的差别


二、实验过程(学生补充完整的细节并作简要的解释)


(一)准备
1、 服务器 192.168.233.3,以root登录。
   login as: root
   root@192.168.177.3's password:
   Last login: Wed Apr  1 22:26:32 2015 from 192.168.177.1


2、 检查vsftpd 是否安装
# rpm -q vsftpd


   [root@localhost root]# rpm -q vsftpd
   vsftpd-1.1.3-8


3、 检查httpd是否已启动
# ps -ax | grep vsftpd


   [root@localhost root]# ps -ax | grep vsftpd
   4535 ?        S      0:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
   4598 pts/0    S      0:00 grep vsftpd


4、切换到用户yanji
创建文件 sprnight.txt,内容:
春眠不觉晓
处处闻啼鸟
夜来风雨声
花落知多少


    [root@localhost root]# su - yanji
    [yanji@localhost yanji]$
    [yanji@localhost yanji]$ cat >  sprnight.txt
春眠不觉晓
处处闻啼鸟
夜来风雨声
花落知多少


(二)客户端:window资源管理器
以yanji登录
1、下载文件 sprnight.txt 到 D:,查看内容。
  
春眠不觉晓
处处闻啼鸟
夜来风雨声
花落知多少




2、上传一个文件。服务器上查看该文件。


创建文件 sprnight1.txt,内容:
春眠不觉晓
处处闻啼鸟
夜来风雨声
花落知多少


上传到服务器后查看:


春眠不觉晓


处处闻啼鸟


夜来风雨声


花落知多少






(三)支持文本模式
服务器上,修改vsftpd.conf 的相关行,重启 vsftpd。
   [root@localhost root]# vi /etc/vsftpd/vsftpd.conf
把下面两行前面的#去掉,保存。
ascii_upload_enable=YES
ascii_download_enable=YES


   [root@localhost root]# service  vsftpd restart
关闭 vsftpd:                                              [  确定  ]
为 vsftpd 启动 vsftpd:                                    [  确定  ]




(四)通用客户端:ftp 命令
在window的命令行窗口
C:> ftp 192.168.233.3
以用户名yanji、密码yanji123登录。
1、下载文件 sprnight.txt 到D:,查看内容。


   C:\Users\Administrator>ftp 192.168.177.3
   连接到 192.168.177.3。
   220 (vsFTPd 1.1.3)
   用户(192.168.177.3:(none)): yanji
   331 Please specify the password.
   密码:
   230 Login successful. Have fun.
   ftp> ls
   200 PORT command successful. Consider using PASV.
   150 Here comes the directory listing.
   01
   moon.txt
   sprnight.txt
   226 Directory send OK.
   ftp: 收到 28 字节,用时 0.00秒 28.00千字节/秒。
   ftp> lcd d:\
   目前的本地目录 D:\。
   ftp> get sprnight.txt
   200 PORT command successful. Consider using PASV.
   150 Opening ASCII mode data connection for sprnight.txt (75 bytes).
   226 File send OK.
   ftp: 收到 83 字节,用时 0.00秒 83000.00千字节/秒。


内容:
春眠不觉晓
处处闻啼鸟夜来风雨声花落知多少


2、上传文件
window 上用记事本创建 d:redbeen.txt;
红豆生南国
春来发几枝
愿君多采撷
此物最相思
上传 d:readbeen.txt。服务器上查看该文件。


    C:\Users\Administrator>ftp 192.168.177.3
    连接到 192.168.177.3。
    220 (vsFTPd 1.1.3)
    用户(192.168.177.3:(none)): yanji
    331 Please specify the password.
    密码:
    230 Login successful. Have fun.
    ftp> ls
    200 PORT command successful. Consider using PASV.
    150 Here comes the directory listing.
    01
    moon.txt
    sprnight.txt
    226 Directory send OK.
    ftp: 收到 28 字节,用时 0.00秒 9.33千字节/秒。
    ftp> lcd d:\
    目前的本地目录 D:\。
    ftp> put redbeen..txt
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 File receive OK.
ftp: 发送 46 字节,用时 0.00秒 46.00千字节/秒。


三、实验的体会


学会了使用FTP的方法和配置,但是还不熟悉,看不明英文注释
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值