FTP服务器的搭建与维护

<!-- /* Font Definitions */ @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"MS Gothic"; panose-1:2 11 6 9 7 2 5 8 2 4; mso-font-alt:"MS ゴシック"; mso-font-charset:128; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:-1610612033 1757936891 16 0 131231 0;} @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:"/@宋体"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"MS UI Gothic"; panose-1:2 11 6 0 7 2 5 8 2 4; mso-font-charset:128; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610612033 1757936891 16 0 131231 0;} @font-face {font-family:"/@MS Gothic"; panose-1:2 11 6 9 7 2 5 8 2 4; mso-font-charset:128; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:-1610612033 1757936891 16 0 131231 0;} @font-face {font-family:"/@MS UI Gothic"; panose-1:2 11 6 0 7 2 5 8 2 4; mso-font-charset:128; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610612033 1757936891 16 0 131231 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; mso-pagination:none; font-size:10.5pt; mso-bidi-font-size:12.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:宋体; mso-font-kerning:1.0pt;} p.MsoHeader, li.MsoHeader, div.MsoHeader {mso-style-unhide:no; mso-style-link:"页眉 Char"; margin:0cm; margin-bottom:.0001pt; text-align:center; mso-pagination:none; tab-stops:center 207.65pt right 415.3pt; layout-grid-mode:char; border:none; mso-border-bottom-alt:solid windowtext .75pt; padding:0cm; mso-padding-alt:0cm 0cm 1.0pt 0cm; font-size:9.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:宋体; mso-font-kerning:1.0pt;} p.MsoFooter, li.MsoFooter, div.MsoFooter {mso-style-unhide:no; mso-style-link:"页脚 Char"; margin:0cm; margin-bottom:.0001pt; mso-pagination:none; tab-stops:center 207.65pt right 415.3pt; layout-grid-mode:char; font-size:9.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:宋体; mso-font-kerning:1.0pt;} span.Char {mso-style-name:"页脚 Char"; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:页脚; mso-ansi-font-size:9.0pt; mso-bidi-font-size:9.0pt; mso-font-kerning:1.0pt;} span.Char0 {mso-style-name:"页眉 Char"; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:页眉; mso-ansi-font-size:9.0pt; mso-bidi-font-size:9.0pt; mso-font-kerning:1.0pt;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt; mso-ascii-font-family:"Times New Roman"; mso-fareast-font-family:宋体; mso-hansi-font-family:"Times New Roman"; mso-font-kerning:0pt;} /* Page Definitions */ @page {mso-page-border-surround-header:no; mso-page-border-surround-footer:no;} @page Section1 {size:595.3pt 841.9pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:42.55pt; mso-footer-margin:49.6pt; mso-page-numbers:1; mso-page-numbers-chapter-style:header-1; mso-paper-source:0; layout-grid:15.6pt;} div.Section1 {page:Section1;} -->

FTP 服务器的搭建            

FTP 的作用 FTP 的主要作用,就是让用户连接上一个远程计算机(这些计算机上运行着 FTP 服务器程序)察看远程计算机有哪些文件,然后把文件从远程计算机上拷到本地计算机,或把本地计算机的文件送到远程计算机去。

FTP 服务器的两个端口号:     21 (传输数据)和 20 (接收请求)。

FTP 使用者:   本地用户,虚拟用户,匿名用户   

匿名用户的登陆账号规定为 anonymous[ə'n ɔ niməs] ,别名为 ftp, 登陆密码也是 ftp  

1. 检查是否安装了 proftpd 服务器:     rpm  –qa | grep proftpd     

2. 查看 proftpd 服务器的进程状态: ps  -eaf | grep  proftpd 

3.proftpd 的启动、停止、重启、完美重启 service  proftpd  [start stop restart graceful  

4. 配置文件: /etc/proftpd.conf

5. 登陆 FTP 服务器:   ftp +IP 地址 ftp 回车 然后输入 open  + IP 地址   

6. 中断与服务器的连接 ftp>  bye ( 回车 )  or  quit( 回车 )

配置文件( proftpd.conf ):

DefaultRoot  ~   {指定所有用户登陆时直接进入其家目录}

DefaultChdir  /   {cd时只能在转的其家目录一下}

Umask    022 {确定新建目录和文件的权限}

<Limit READ>

   allowall        {登陆用户拥有读权限}

<Limit STOR>

   DenyAll               { 登陆用户拥有上传权限 }

UserAlias  anonymous  ftp     { anonymous 用户起别名为 ftp< 匿名登陆时用 >}

1. 连接 ftp 服务器

格式: ftp [hostname   ip-address]

a) linux 命令行下输入: ftp 10.18.34.115

b) 服务器询问你用户名和口令,分别输入 yint 和相应密码,待认证通过即可。

2. 下载文件

下载文件通常用 get mget 这两条命令。

1 get

格式: get [remote-file] [local-file]

将文件从远端主机中传送至本地主机中 .

如要获取服务器上 E:/rose/1.bmp,

ftp> get /rose/1.bmp 1.bmp ( 回车 )

2 mget

格式: mget [remote-files]

从远端主机接收一批文件至本地主机 .

如要获取服务器上 E:/rose/ 下的所有文件 ,

ftp> cd /rose   ftp> mget *.* ( 回车 )

注意:文件都下载到了 linux 主机的当前目录下。比如,在  /root/yint 下运行的 ftp 命令,则文件都下载到了 /root/yint 下。

3. 上传文件

put

格式: put local-file [remote-file]

将本地一个文件传送至远端主机中 .

如要把本地的 1.bmp 传送到远端主机 E:/rose, 并改名为 333.bmp

ftp> put   1.bmp   /rose/333.bmp ( 回车 )

mput

格式: mput   local-files

将本地主机中一批文件传送至远端主机 .

要把本地当前目录下所有 bmp 文件上传到服务器 E:/rose

ftp> cd   /rose (回车)   ftp> mput   *.bmp  (回车)

注意:上传文件都来自于主机的当前目录下。比如,在  /root/yint 下运行的 ftp 命令,则只有在 /root/yint 下的文件 linux 才会上传到服务器 E:/rose 下。

登陆到 ftp 服务器上后,该对本地进行操作用 ( + 命令 ), 对远程登陆进行操作(直接使用各种命令)。

ascii/asc ---- 使用字符方式传输,只适合 ascii 文件

binary/bin ---- 使用二进制方式传输,适合所有文件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值