前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >学习笔记0525----NFS文件共享和FTP服务器

学习笔记0525----NFS文件共享和FTP服务器

作者头像
嘻哈记
发布2020-11-24 10:26:57
3.1K0
发布2020-11-24 10:26:57
举报
文章被收录于专栏:运维学习交流

NFS文件共享和FTP服务器

预习笔记

14.1 NFS介绍 14.2 NFS服务端安装配置 14.3 NFS配置选项 14.4 exportfs命令 14.5 NFS客户端问题 15.1 FTP介绍 15.2/15.3 使用vsftpd搭建ftp 15.4 xshell使用xftp传输文件 15.5 使用pure-ftpd搭建ftp服务 扩展 vsftp使用mysql存放虚拟用户并验证 http://www.aminglinux.com/bbs/thread-342-1-1.html ftp的主动和被动模式 http://www.aminglinux.com/bbs/thread-961-1-1.html

1. NFS简介

  • NFS,Network File System。网络文件系统,即通过网络,对在不同主机上的文件进行共享
  • NFS最早由Sun公司开发,分2,3,4三个版本,2和3由Sun起草开发,4.0开始Netapp公司参与并主导开发,最新为4.1版本,更新比较慢其实4.1是从2010年就开始使用了。
  • NFS数据传输基于RPC协议,RPC为Remote Procedure Call的简写。它是能使客户端执行其他系统中程序的一种机制。NFS可以看作是一个RPC Server,主要功能是管理需要分享的目录和文件。它不负责通信和信息传输,而是把这部分工作交给RPC协议来完成。即NFS在文件传送或信息传送过程中依赖于RPC协议。所以只要用到NFS的地方都要启动RPC服务,不论是NFS SERVER或者NFS CLIENT。这样SERVER和CLIENT才能通过RPC来实现PROGRAM PORT的对应。可以这么理解RPC和NFS的关系:NFS是一个文件系统,而RPC是负责负责信息的传输。
  • NFS应用场景是:A,B,C三台机器上需要保证被访问到的文件是一样的,A共享数据出来,B和C分别去挂载A共享的数据目录,从而B和C访问到的数据和A上的一致。
在这里插入图片描述
在这里插入图片描述

2. NFS服安装配置

用两台机器做实验,一台作为服务端(linux-001 192.168.141.128),一台作为客户端(linux-02 192.168.141.129)

2.1 服务端得安装配置

2.1.1 服务端和客户端分别安装nfs-utils
代码语言:javascript
复制
[root@linux-001 ~]# yum install -y nfs-utils rpcbind
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                          | 7.0 kB  00:00:00     
 * base: mirrors.aliyun.com
 * epel: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                                          | 3.6 kB  00:00:00     
epel                                                                                                          | 4.7 kB  00:00:00     
extras                                                                                                        | 3.4 kB  00:00:00     
updates                                                                                                       | 3.4 kB  00:00:00     
(1/3): extras/7/x86_64/primary_db                                                                             | 200 kB  00:00:00     
(2/3): epel/x86_64/primary_db                                                                                 | 6.7 MB  00:00:04     
epel/x86_64/updateinfo         FAILED                                          
http://ftp.riken.jp/Linux/fedora/epel/7/x86_64/repodata/63e651af768aaf626aec9f32f0a7e4e354152e96316aed7f1c0e2513e5cf4328-updateinfo.xml.bz2: [Errno 12] Timeout on http://ftp.riken.jp/Linux/fedora/epel/7/x86_64/repodata/63e651af768aaf626aec9f32f0a7e4e354152e96316aed7f1c0e2513e5cf4328-updateinfo.xml.bz2: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
正在尝试其它镜像。
(3/3): epel/x86_64/updateinfo                                                                                 | 1.0 MB  00:00:02     
正在解决依赖关系
--> 正在检查事务
---> 软件包 nfs-utils.x86_64.1.1.3.0-0.61.el7 将被 安装
--> 正在处理依赖关系 libtirpc >= 0.2.4-0.7,它被软件包 1:nfs-utils-1.3.0-0.61.el7.x86_64 需要
--> 正在处理依赖关系 gssproxy >= 0.7.0-3,它被软件包 1:nfs-utils-1.3.0-0.61.el7.x86_64 需要
--> 正在处理依赖关系 quota,它被软件包 1:nfs-utils-1.3.0-0.61.el7.x86_64 需要
--> 正在处理依赖关系 libnfsidmap,它被软件包 1:nfs-utils-1.3.0-0.61.el7.x86_64 需要
--> 正在处理依赖关系 libevent,它被软件包 1:nfs-utils-1.3.0-0.61.el7.x86_64 需要
--> 正在处理依赖关系 keyutils,它被软件包 1:nfs-utils-1.3.0-0.61.el7.x86_64 需要
--> 正在处理依赖关系 libtirpc.so.1()(64bit),它被软件包 1:nfs-utils-1.3.0-0.61.el7.x86_64 需要
--> 正在处理依赖关系 libnfsidmap.so.0()(64bit),它被软件包 1:nfs-utils-1.3.0-0.61.el7.x86_64 需要
--> 正在处理依赖关系 libevent-2.0.so.5()(64bit),它被软件包 1:nfs-utils-1.3.0-0.61.el7.x86_64 需要
---> 软件包 rpcbind.x86_64.0.0.2.0-47.el7 将被 安装
--> 正在检查事务
---> 软件包 gssproxy.x86_64.0.0.7.0-21.el7 将被 安装
--> 正在处理依赖关系 libini_config >= 1.3.1-31,它被软件包 gssproxy-0.7.0-21.el7.x86_64 需要
--> 正在处理依赖关系 libverto-module-base,它被软件包 gssproxy-0.7.0-21.el7.x86_64 需要
--> 正在处理依赖关系 libref_array.so.1(REF_ARRAY_0.1.1)(64bit),它被软件包 gssproxy-0.7.0-21.el7.x86_64 需要
--> 正在处理依赖关系 libini_config.so.3(INI_CONFIG_1.2.0)(64bit),它被软件包 gssproxy-0.7.0-21.el7.x86_64 需要
--> 正在处理依赖关系 libini_config.so.3(INI_CONFIG_1.1.0)(64bit),它被软件包 gssproxy-0.7.0-21.el7.x86_64 需要
--> 正在处理依赖关系 libref_array.so.1()(64bit),它被软件包 gssproxy-0.7.0-21.el7.x86_64 需要
--> 正在处理依赖关系 libini_config.so.3()(64bit),它被软件包 gssproxy-0.7.0-21.el7.x86_64 需要
--> 正在处理依赖关系 libcollection.so.2()(64bit),它被软件包 gssproxy-0.7.0-21.el7.x86_64 需要
--> 正在处理依赖关系 libbasicobjects.so.0()(64bit),它被软件包 gssproxy-0.7.0-21.el7.x86_64 需要
---> 软件包 keyutils.x86_64.0.1.5.8-3.el7 将被 安装
---> 软件包 libevent.x86_64.0.2.0.21-4.el7 将被 安装
---> 软件包 libnfsidmap.x86_64.0.0.25-19.el7 将被 安装
---> 软件包 libtirpc.x86_64.0.0.2.4-0.15.el7 将被 安装
---> 软件包 quota.x86_64.1.4.01-17.el7 将被 安装
--> 正在处理依赖关系 quota-nls = 1:4.01-17.el7,它被软件包 1:quota-4.01-17.el7.x86_64 需要
--> 正在处理依赖关系 tcp_wrappers,它被软件包 1:quota-4.01-17.el7.x86_64 需要
--> 正在检查事务
---> 软件包 libbasicobjects.x86_64.0.0.1.1-32.el7 将被 安装
---> 软件包 libcollection.x86_64.0.0.7.0-32.el7 将被 安装
---> 软件包 libini_config.x86_64.0.1.3.1-32.el7 将被 安装
--> 正在处理依赖关系 libpath_utils.so.1(PATH_UTILS_0.2.1)(64bit),它被软件包 libini_config-1.3.1-32.el7.x86_64 需要
--> 正在处理依赖关系 libpath_utils.so.1()(64bit),它被软件包 libini_config-1.3.1-32.el7.x86_64 需要
---> 软件包 libref_array.x86_64.0.0.1.5-32.el7 将被 安装
---> 软件包 libverto-libevent.x86_64.0.0.2.5-4.el7 将被 安装
---> 软件包 quota-nls.noarch.1.4.01-17.el7 将被 安装
---> 软件包 tcp_wrappers.x86_64.0.7.6-77.el7 将被 安装
--> 正在检查事务
---> 软件包 libpath_utils.x86_64.0.0.2.1-32.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=====================================================================================================================================
 Package                              架构                      版本                                   源                       大小
=====================================================================================================================================
正在安装:
 nfs-utils                            x86_64                    1:1.3.0-0.61.el7                       base                    410 k
 rpcbind                              x86_64                    0.2.0-47.el7                           base                     60 k
为依赖而安装:
 gssproxy                             x86_64                    0.7.0-21.el7                           base                    109 k
 keyutils                             x86_64                    1.5.8-3.el7                            base                     54 k
 libbasicobjects                      x86_64                    0.1.1-32.el7                           base                     26 k
 libcollection                        x86_64                    0.7.0-32.el7                           base                     42 k
 libevent                             x86_64                    2.0.21-4.el7                           base                    214 k
 libini_config                        x86_64                    1.3.1-32.el7                           base                     64 k
 libnfsidmap                          x86_64                    0.25-19.el7                            base                     50 k
 libpath_utils                        x86_64                    0.2.1-32.el7                           base                     28 k
 libref_array                         x86_64                    0.1.5-32.el7                           base                     27 k
 libtirpc                             x86_64                    0.2.4-0.15.el7                         base                     89 k
 libverto-libevent                    x86_64                    0.2.5-4.el7                            base                    8.9 k
 quota                                x86_64                    1:4.01-17.el7                          base                    179 k
 quota-nls                            noarch                    1:4.01-17.el7                          base                     90 k
 tcp_wrappers                         x86_64                    7.6-77.el7                             base                     78 k

事务概要
=====================================================================================================================================
安装  2 软件包 (+14 依赖软件包)

总下载量:1.5 M
安装大小:4.2 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/16): libcollection-0.7.0-32.el7.x86_64.rpm                                                                 |  42 kB  00:00:00     
(2/16): libbasicobjects-0.1.1-32.el7.x86_64.rpm                                                               |  26 kB  00:00:00     
(3/16): libini_config-1.3.1-32.el7.x86_64.rpm                                                                 |  64 kB  00:00:00     
(4/16): libevent-2.0.21-4.el7.x86_64.rpm                                                                      | 214 kB  00:00:00     
(5/16): libpath_utils-0.2.1-32.el7.x86_64.rpm                                                                 |  28 kB  00:00:00     
(6/16): libnfsidmap-0.25-19.el7.x86_64.rpm                                                                    |  50 kB  00:00:00     
(7/16): libtirpc-0.2.4-0.15.el7.x86_64.rpm                                                                    |  89 kB  00:00:00     
(8/16): libref_array-0.1.5-32.el7.x86_64.rpm                                                                  |  27 kB  00:00:00     
(9/16): libverto-libevent-0.2.5-4.el7.x86_64.rpm                                                              | 8.9 kB  00:00:00     
(10/16): nfs-utils-1.3.0-0.61.el7.x86_64.rpm                                                                  | 410 kB  00:00:00     
(11/16): quota-4.01-17.el7.x86_64.rpm                                                                         | 179 kB  00:00:00     
(12/16): quota-nls-4.01-17.el7.noarch.rpm                                                                     |  90 kB  00:00:00     
(13/16): tcp_wrappers-7.6-77.el7.x86_64.rpm                                                                   |  78 kB  00:00:00     
(14/16): rpcbind-0.2.0-47.el7.x86_64.rpm                                                                      |  60 kB  00:00:00     
(15/16): keyutils-1.5.8-3.el7.x86_64.rpm                                                                      |  54 kB  00:00:01     
(16/16): gssproxy-0.7.0-21.el7.x86_64.rpm                                                                     | 109 kB  00:00:05     
-------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                 251 kB/s | 1.5 MB  00:00:06     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : libtirpc-0.2.4-0.15.el7.x86_64                                                                                  1/16 
  正在安装    : rpcbind-0.2.0-47.el7.x86_64                                                                                     2/16 
  正在安装    : libbasicobjects-0.1.1-32.el7.x86_64                                                                             3/16 
  正在安装    : libref_array-0.1.5-32.el7.x86_64                                                                                4/16 
  正在安装    : libcollection-0.7.0-32.el7.x86_64                                                                               5/16 
  正在安装    : libevent-2.0.21-4.el7.x86_64                                                                                    6/16 
  正在安装    : libverto-libevent-0.2.5-4.el7.x86_64                                                                            7/16 
  正在安装    : tcp_wrappers-7.6-77.el7.x86_64                                                                                  8/16 
  正在安装    : keyutils-1.5.8-3.el7.x86_64                                                                                     9/16 
  正在安装    : libnfsidmap-0.25-19.el7.x86_64                                                                                 10/16 
  正在安装    : libpath_utils-0.2.1-32.el7.x86_64                                                                              11/16 
  正在安装    : libini_config-1.3.1-32.el7.x86_64                                                                              12/16 
  正在安装    : gssproxy-0.7.0-21.el7.x86_64                                                                                   13/16 
  正在安装    : 1:quota-nls-4.01-17.el7.noarch                                                                                 14/16 
  正在安装    : 1:quota-4.01-17.el7.x86_64                                                                                     15/16 
  正在安装    : 1:nfs-utils-1.3.0-0.61.el7.x86_64                                                                              16/16 
  验证中      : 1:quota-nls-4.01-17.el7.noarch                                                                                  1/16 
  验证中      : libverto-libevent-0.2.5-4.el7.x86_64                                                                            2/16 
  验证中      : libpath_utils-0.2.1-32.el7.x86_64                                                                               3/16 
  验证中      : libnfsidmap-0.25-19.el7.x86_64                                                                                  4/16 
  验证中      : libevent-2.0.21-4.el7.x86_64                                                                                    5/16 
  验证中      : 1:nfs-utils-1.3.0-0.61.el7.x86_64                                                                               6/16 
  验证中      : gssproxy-0.7.0-21.el7.x86_64                                                                                    7/16 
  验证中      : keyutils-1.5.8-3.el7.x86_64                                                                                     8/16 
  验证中      : rpcbind-0.2.0-47.el7.x86_64                                                                                     9/16 
  验证中      : tcp_wrappers-7.6-77.el7.x86_64                                                                                 10/16 
  验证中      : libcollection-0.7.0-32.el7.x86_64                                                                              11/16 
  验证中      : libref_array-0.1.5-32.el7.x86_64                                                                               12/16 
  验证中      : libbasicobjects-0.1.1-32.el7.x86_64                                                                            13/16 
  验证中      : 1:quota-4.01-17.el7.x86_64                                                                                     14/16 
  验证中      : libini_config-1.3.1-32.el7.x86_64                                                                              15/16 
  验证中      : libtirpc-0.2.4-0.15.el7.x86_64                                                                                 16/16 

已安装:
  nfs-utils.x86_64 1:1.3.0-0.61.el7                                   rpcbind.x86_64 0:0.2.0-47.el7                                  

作为依赖被安装:
  gssproxy.x86_64 0:0.7.0-21.el7            keyutils.x86_64 0:1.5.8-3.el7                libbasicobjects.x86_64 0:0.1.1-32.el7      
  libcollection.x86_64 0:0.7.0-32.el7       libevent.x86_64 0:2.0.21-4.el7               libini_config.x86_64 0:1.3.1-32.el7        
  libnfsidmap.x86_64 0:0.25-19.el7          libpath_utils.x86_64 0:0.2.1-32.el7          libref_array.x86_64 0:0.1.5-32.el7         
  libtirpc.x86_64 0:0.2.4-0.15.el7          libverto-libevent.x86_64 0:0.2.5-4.el7       quota.x86_64 1:4.01-17.el7                 
  quota-nls.noarch 1:4.01-17.el7            tcp_wrappers.x86_64 0:7.6-77.el7            

完毕!
2.1.2 设置共享目录
  • /home/nfstestdir :共享的目录
  • rw: 读写
  • ro: 只读
  • sync: 同步模式,内存数据实时写入磁盘
  • async :非同步模式
  • no_root_squash: 客户端挂载NFS共享目录后,root用户不受约束,权限很大
  • root_squash: 与上面选项相对,客户端上的root用户收到约束,被限定成某个普通用户
  • all_squash:客户端上所有用户在使用NFS共享目录时都被限定为一个普通用户
  • anonuid/anongid: 和上面几个选项搭配使用,定义被限定用户的uid和gid
  • 192.168.141.0/24:为客户端的网段
代码语言:javascript
复制
[root@linux-001 ~]# vim /etc/exports
/home/nfstestdir 192.168.141.0/24(rw,sync,all_squash,anonuid=1000,anongid=1000)

[root@linux-001 ~]# mkdir /home/nfstestdir
[root@linux-001 ~]# chmod 777 /home/nfstestdir

[root@linux-001 ~]# netstat -lnpt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd           
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      6859/sshd           
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      7242/master         
tcp6       0      0 :::3306                 :::*                    LISTEN      7142/mysqld         
tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd           
tcp6       0      0 :::22                   :::*                    LISTEN      6859/sshd           
tcp6       0      0 ::1:25                  :::*                    LISTEN      7242/master         
[root@linux-001 ~]#  
2.1.3 启动nfs服务
代码语言:javascript
复制
[root@linux-001 ~]# systemctl  start  nfs.service
[root@linux-001 ~]# ps aux | grep nfs
root       7990  0.0  0.0      0     0 ?        S<   03:57   0:00 [nfsd4_callbacks]
root       7996  0.0  0.0      0     0 ?        S    03:57   0:00 [nfsd]
root       7997  0.0  0.0      0     0 ?        S    03:57   0:00 [nfsd]
root       7998  0.0  0.0      0     0 ?        S    03:57   0:00 [nfsd]
root       7999  0.0  0.0      0     0 ?        S    03:57   0:00 [nfsd]
root       8000  0.0  0.0      0     0 ?        S    03:57   0:00 [nfsd]
root       8001  0.0  0.0      0     0 ?        S    03:57   0:00 [nfsd]
root       8002  0.0  0.0      0     0 ?        S    03:57   0:00 [nfsd]
root       8003  0.0  0.0      0     0 ?        S    03:57   0:00 [nfsd]
root       8079  0.0  0.0 112724   988 pts/0    R+   03:57   0:00 grep --color=auto nfs
[root@linux-001 ~]# ps aux | grep rpc
rpc        7937  0.0  0.0  69264  1544 ?        Ss   03:57   0:00 /sbin/rpcbind -w
root       7939  0.0  0.0      0     0 ?        S<   03:57   0:00 [rpciod]
rpcuser    7954  0.0  0.0  42432  1768 ?        Ss   03:57   0:00 /usr/sbin/rpc.statd
root       7981  0.0  0.0  45956   544 ?        Ss   03:57   0:00 /usr/sbin/rpc.idmapd
root       7985  0.0  0.0  42624   952 ?        Ss   03:57   0:00 /usr/sbin/rpc.mountd
root       8088  0.0  0.0 112724   984 pts/0    R+   03:58   0:00 grep --color=auto rpc
[root@linux-001 ~]# 
2.1.4 设置开机启动
代码语言:javascript
复制
[root@linux-001 ~]# systemctl  enable  nfs.service
Created symlink from /etc/systemd/system/multi-user.target.wants/nfs-server.service to /usr/lib/systemd/system/nfs-server.service.

2.2 客户端挂载nfs

2.2.1 挂载客户端的目录
代码语言:javascript
复制
[root@linux-02 ~]# showmount -e 192.168.141.128
clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host
  • 如果出现以上得信息,说明无法与服务器通信,需要检查一下内容:
  • 检查服务端得 nfs 服务和 rpcbind 服务是否启动。
  • 检查服务端的防火墙 firewalld 和 selinux 是否关闭了。
  • 检查服务端得 iptables 是否清空了。
  • 检查客户端得 rpcbind 服务是否启动。
代码语言:javascript
复制
[root@linux-02 ~]# showmount -e 192.168.141.128
Export list for 192.168.141.128:
/home/nfstestdir 192.168.141.0/24

如果出现上面得信息,说明可以与服务端进行通信。然后可以挂载服务端的目录到客户端。

代码语言:javascript
复制
[root@linux-02 ~]# mount -t nfs 192.168.141.128:/home/nfstestdir /mnt/
[root@linux-02 ~]# df -h
文件系统                          容量  已用  可用 已用% 挂载点
/dev/sda3                          16G  5.9G   10G   37% /
devtmpfs                          900M     0  900M    0% /dev
tmpfs                             911M     0  911M    0% /dev/shm
tmpfs                             911M  9.5M  901M    2% /run
tmpfs                             911M     0  911M    0% /sys/fs/cgroup
/dev/sda1                         197M  115M   82M   59% /boot
tmpfs                             183M     0  183M    0% /run/user/0
192.168.141.128:/home/nfstestdir   16G  7.8G  8.1G   50% /mnt
[root@linux-02 ~]# 
2.2.2 测试挂载得目录是否可以写数据
在这里插入图片描述
在这里插入图片描述
  • 上图种为什么服务端得用户和用户组是xihaji ,客户端得用户是mysql ?
  • 原因是我们在服务端配置写的使用此目录得用户为uid和gid为1000得用户,所以在客户端上看到是mysql ,服务端看到得是xihaji
在这里插入图片描述
在这里插入图片描述

2.3 exportfs命令常用选项

2.3.1 服务端重新设置nfs共享目录

服务端设置tmp目录为共享目录,并且root用户不做任何限制,使用exportfs重新加载配置文件。

代码语言:javascript
复制
[root@linux-001 nfstestdir]# vim /etc/exports
/home/nfstestdir 192.168.141.0/24(rw,sync,all_squash,anonuid=1000,anongid=1000)
/tmp  192.168.141.129(rw,sync,no_root_squash)


[root@linux-001 nfstestdir]# exportfs -arv
exporting 192.168.141.129:/tmp
exporting 192.168.141.0/24:/home/nfstestdir
2.3.2 客户端查看共享目录并挂载

客户端使用showmount命令查看nfs服务器共享得目录,并挂载tmp目录。

代码语言:javascript
复制
[root@linux-02 mnt]# showmount -e 192.168.141.128
Export list for 192.168.141.129:
/home/nfstestdir 192.168.141.0/24
/tmp             192.168.141.129
[root@linux-02 mnt]# mount -t nfs 192.168.141.128:/tmp /home/tmp
[root@linux-02 mnt]# 
2.3.3 测试

服务端创建一个11.txt文件,在server端可以查看到,用户和用户组都为root,在使用nfs得时候一般会对root用户做权限设置。

在这里插入图片描述
在这里插入图片描述

3.NFS客户端属主属组是nobody

NFS 4版本在centos6上常见此问题,我们在分享一个目录且权限设置为no_root_squash,客户端看到的文件属主、组不是root,却是nobody。 这个不是设置错误,是软件本身自带的BUG。

3.1 解决方案一

在客户端挂载的时候加上 -o nfsvers=3,其目的是指定nfs使用3版本。

代码语言:javascript
复制
[root@linux-02 tmp]# mount -t nfs -o,nfsvers=3 192.168.141.128:/tmp /mnt/
[root@linux-02 tmp]# 

或者添加remount,重新挂载。

代码语言:javascript
复制
[root@linux-02 tmp]# mount -t nfs -oremount,nfsvers=3 192.168.141.128:/tmp /mnt
[root@linux-02 tmp]# 

3.2 解决方案二

在服务端和客户端配置:vim /etc/idmapd.conf 配置文种把“#Domain = local.domain.edu” 改为 “Domain = xxx.com” (这里的xxx.com,随意定义吧),然后再重启rpcidmapd服务,centos7没有 rpcidmapd 服务,重启 rpcbind 服务即可。

代码语言:javascript
复制
[root@linux-001 tmp]# vi /etc/idmapd.conf

#Domain = local.domain.edu // 改为 Domain = xxx.com

4. FTP服务器

4.1 FTP服务器简介

  • 我们之前传输文件所用的是rzsz命令,可以简单明了的就把我们所需的文件下载或者上传。但是有个缺陷,不可以上传或者下载大体积的文件。FTP就可以解决这个问题。
  • FTP有以下特点:
  • FTP是File Transfer Protocol(文件传输协议,简称文传协议)的英文简称,用于在Internet上控制文件的双向传输。
  • FTP的主要作用就是让用户连接一个远程计算机(这些计算机上运行着FTP服务器程序),并查看远程计算机中的文件,然后把文件从远程计算机复制到本地计算机,或把本地计算机的文件传送到远程计算机。
  • 小公司用的多,大企业不用FTP,因为不安全。

4.2 FTP服务器搭建

4.2.1 安装vsftp软件
代码语言:javascript
复制
[root@linux-001 ~]# yum install -y vsftpd
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 vsftpd.x86_64.0.3.0.2-25.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

====================================================================================================================================
 Package                       架构                          版本                                 源                           大小
====================================================================================================================================
正在安装:
 vsftpd                        x86_64                        3.0.2-25.el7                         base                        171 k

事务概要
====================================================================================================================================
安装  1 软件包

总下载量:171 k
安装大小:353 k
Downloading packages:
vsftpd-3.0.2-25.el7.x86_64.rpm                                                                               | 171 kB  00:00:06     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : vsftpd-3.0.2-25.el7.x86_64                                                                                      1/1 
  验证中      : vsftpd-3.0.2-25.el7.x86_64                                                                                      1/1 

已安装:
  vsftpd.x86_64 0:3.0.2-25.el7                                                                                                      

完毕!
[root@linux-001 ~]# 
4.2.2 创建ftp的系统用户和虚拟用户

ftp默认支持使用系统账号登录,但是因为安全原因,建议使用虚拟用户映射到系统登录。

代码语言:javascript
复制
## 创建一个系统用户,-s指定用户的shell ##
[root@linux-001 ~]# useradd -s /sbin/nologin vsftp
## 创建一个虚拟用户的文件,奇数行用户名,偶数行密码 ##
[root@linux-001 ~]# vim /etc/vsftpd/vsftpd_login
[root@linux-001 ~]# cat !$
cat /etc/vsftpd/vsftpd_login
ftpuser1
ftpuser1
ftpuser2
ftpuser2

[root@linux-001 ~]# chmod 600 /etc/vsftpd/vsftpd_login
4.2.3 生成虚拟用户的一个库文件

由于我们设置的vsftpd_login文件是一个明文文本文件,所以需要生成一个二进制文件让系统能够识别。

代码语言:javascript
复制
[root@linux-001 ~]# db_load -T -t hash -f /etc/vsftpd/vsftpd_login /etc/vsftpd/vsftpd_login.db

[root@linux-001 ~]# ls -l /etc/vsftpd/
总用量 36
-rw------- 1 root root   125 10月 31 2018 ftpusers
-rw------- 1 root root   361 10月 31 2018 user_list
-rw------- 1 root root  5116 10月 31 2018 vsftpd.conf
-rwxr--r-- 1 root root   338 10月 31 2018 vsftpd_conf_migrate.sh
-rw------- 1 root root    36 5月  25 09:07 vsftpd_login
-rw-r--r-- 1 root root 12288 5月  25 09:11 vsftpd_login.db
[root@linux-001 ~]# 
4.2.4 创建虚拟用户的配置文件

创建一个虚拟用户存放配置的文件夹,在创建虚拟用户的配置文件的时候,一个虚拟用户一个配置文件,并且虚拟用户的配置文件名是以虚拟用户的名称来命名。

代码语言:javascript
复制
[root@linux-001 ~]# mkdir /etc/vsftpd/vsftpd_user_conf
[root@linux-001 ~]# cd !$
cd /etc/vsftpd/vsftpd_user_conf
[root@linux-001 vsftpd_user_conf]# vim ftpuser1

local_root=/home/vsftp/ftpuser1 //虚拟用户的家目录
anonymous_enable=NO //是否允许匿名用户
write_enable=YES //是否允许可写
local_umask=022 //创建新目录和文件的权限
anon_upload_enable=NO //是否允许匿名用户上传
anon_mkdir_write_enable=NO //是否允许匿名用户可创建
idle_session_timeout=600 //连接后没有任何操作的超时时间,空闲时间段
data_connection_timeout=120 //数据传输超时时间
max_clients=10 //最大允许连接的clients客户端


[root@linux-001 vsftpd_user_conf]# vim ftpuser2

local_root=/home/vsftp/ftpuser2 
anonymous_enable=NO 
write_enable=YES 
local_umask=022 
anon_upload_enable=NO 
anon_mkdir_write_enable=NO 
idle_session_timeout=600 
data_connection_timeout=120 
max_clients=10 
4.2.5 创建虚拟用户的家目录

在上面创建虚拟用户的时候已经设置过虚拟用户的家目录,所以我们在此处创建下用户的家目录,并且给虚拟用户创建的家目录设置属主属组的权限。此处设置属主属组权限不是虚拟用户的权限,而是映射到ftp用户的权限。

代码语言:javascript
复制
[root@linux-001 vsftpd_user_conf]# mkdir /home/vsftp/ftpuser1
[root@linux-001 vsftpd_user_conf]# mkdir /home/vsftp/ftpuser2
[root@linux-001 vsftpd_user_conf]# chown -R vsftp:vsftp /home/vsftp/ftpuser1
[root@linux-001 vsftpd_user_conf]# chown -R vsftp:vsftp /home/vsftp/ftpuser2
4.2.6 设置ftp虚拟用户登录的认证文件

需要注意的是,在centos 6中,系统是区分32位和64位,如果我们设置的文件 /lib64/security/pam_userdb.so 这个文件是没有的,那我们的设置的ftp其他位置都正确,那我们的ftp也是无法登录,db后面跟的是 /etc/vsftpd/vsftpd_login 虽然我们需要认证的文件是vsftpd_login.db 文件,但是我们这儿是不可以加“.db”的。注意每行语句后面不能有空格。

代码语言:javascript
复制
[root@linux-001 vsftpd_user_conf]# vim /etc/pam.d/vsftpd

#%PAM-1.0
auth sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login  // 新增行
account sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login // 新增行
session    optional     pam_keyinit.so    force revoke
auth       required     pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
auth       required     pam_shells.so
auth       include      password-auth
account    include      password-auth
session    required     pam_loginuid.so
session    include      password-auth

[root@linux-001 vsftpd_user_conf]# ls /lib64/security/pam_userdb.so
/lib64/security/pam_userdb.so
4.2.7 修改vsftpd的主配置文件
  • anonymous_enable=NO // 是否开启匿名用户
  • anon_upload_enable=NO // 匿名用户是否开启上传
  • anon_mkdir_write_enable=NO // 匿名用户是否可以创建,可写文件
  • chroot_local_user=YES // 是否将所有用户限制在主目录,YES为启用 NO禁用
  • guest_enable=YES // 虚拟用户是否要开启映射到ftp用户
  • guest_username=vsftp // 虚拟用户映射到ftp用户的名称
  • virtual_use_local_privs=YES // 告诉服务我们使用的是虚拟用户
  • user_config_dir=/etc/vsftpd/vsftpd_user_conf // 虚拟用户的配置文件所在路径
  • allow_writeable_chroot=YES // 只能访问自身所属目录。
代码语言:javascript
复制
[root@linux-001 vsftpd_user_conf]# vim /etc/vsftpd/vsftpd.conf

将anonymous_enable=YES 改为 anonymous_enable=NO  
将#anon_upload_enable=YES 改为 anon_upload_enable=NO
将#anon_mkdir_write_enable=YES 改为 anon_mkdir_write_enable=NO

chroot_local_user=YES
guest_enable=YES
guest_username=vsftp
virtual_use_local_privs=YES
user_config_dir=/etc/vsftpd/vsftpd_user_conf
allow_writeable_chroot=YES
4.2.8 启动vsftpd服务

注意:21端口FTP; 22端口SSHD; 23端口TELNET

代码语言:javascript
复制
[root@linux-001 ftpuser2]# service vsftpd start
Redirecting to /bin/systemctl start vsftpd.service
[root@linux-001 ftpuser2]# ps aux | grep vsftp
root      10742  0.0  0.0  53276   576 ?        Ss   09:48   0:00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
root      10753  0.0  0.0 112724   988 pts/0    R+   09:48   0:00 grep --color=auto vsftp
[root@linux-001 ftpuser2]# 

4.3 连接ftp服务器

4.3.1 使用lftp链接服务器
代码语言:javascript
复制
## 安装lftp软件 ##
[root@linux-001 ftpuser2]# yum install -y lftp
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                         | 7.5 kB  00:00:00     
 * base: mirrors.aliyun.com
 * epel: mirrors.njupt.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                                         | 3.6 kB  00:00:00     
extras                                                                                                       | 3.4 kB  00:00:00     
updates                                                                                                      | 3.4 kB  00:00:00     
正在解决依赖关系
--> 正在检查事务
---> 软件包 lftp.x86_64.0.4.4.8-11.el7 将被 安装
--> 正在处理依赖关系 libgnutls.so.28(GNUTLS_1_4)(64bit),它被软件包 lftp-4.4.8-11.el7.x86_64 需要
--> 正在处理依赖关系 libgnutls.so.28()(64bit),它被软件包 lftp-4.4.8-11.el7.x86_64 需要
--> 正在检查事务
---> 软件包 gnutls.x86_64.0.3.3.29-9.el7_6 将被 安装
--> 正在处理依赖关系 trousers >= 0.3.11.2,它被软件包 gnutls-3.3.29-9.el7_6.x86_64 需要
--> 正在处理依赖关系 libnettle.so.4()(64bit),它被软件包 gnutls-3.3.29-9.el7_6.x86_64 需要
--> 正在处理依赖关系 libhogweed.so.2()(64bit),它被软件包 gnutls-3.3.29-9.el7_6.x86_64 需要
--> 正在检查事务
---> 软件包 nettle.x86_64.0.2.7.1-8.el7 将被 安装
---> 软件包 trousers.x86_64.0.0.3.14-2.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

====================================================================================================================================
 Package                       架构                        版本                                  源                            大小
====================================================================================================================================
正在安装:
 lftp                          x86_64                      4.4.8-11.el7                          base                         752 k
为依赖而安装:
 gnutls                        x86_64                      3.3.29-9.el7_6                        updates                      680 k
 nettle                        x86_64                      2.7.1-8.el7                           base                         327 k
 trousers                      x86_64                      0.3.14-2.el7                          base                         289 k

事务概要
====================================================================================================================================
安装  1 软件包 (+3 依赖软件包)

总下载量:2.0 M
安装大小:5.9 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/4): gnutls-3.3.29-9.el7_6.x86_64.rpm                                                                      | 680 kB  00:00:00     
(2/4): nettle-2.7.1-8.el7.x86_64.rpm                                                                         | 327 kB  00:00:00     
(3/4): trousers-0.3.14-2.el7.x86_64.rpm                                                                      | 289 kB  00:00:00     
(4/4): lftp-4.4.8-11.el7.x86_64.rpm                                                                          | 752 kB  00:00:06     
------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                311 kB/s | 2.0 MB  00:00:06     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : nettle-2.7.1-8.el7.x86_64                                                                                       1/4 
  正在安装    : trousers-0.3.14-2.el7.x86_64                                                                                    2/4 
  正在安装    : gnutls-3.3.29-9.el7_6.x86_64                                                                                    3/4 
  正在安装    : lftp-4.4.8-11.el7.x86_64                                                                                        4/4 
  验证中      : trousers-0.3.14-2.el7.x86_64                                                                                    1/4 
  验证中      : gnutls-3.3.29-9.el7_6.x86_64                                                                                    2/4 
  验证中      : lftp-4.4.8-11.el7.x86_64                                                                                        3/4 
  验证中      : nettle-2.7.1-8.el7.x86_64                                                                                       4/4 

已安装:
  lftp.x86_64 0:4.4.8-11.el7                                                                                                        

作为依赖被安装:
  gnutls.x86_64 0:3.3.29-9.el7_6              nettle.x86_64 0:2.7.1-8.el7              trousers.x86_64 0:0.3.14-2.el7             

完毕!
[root@linux-001 ftpuser2]# 
代码语言:javascript
复制
[root@linux-001 vsftpd]# lftp ftpuser1@127.0.0.1
口令: 
lftp ftpuser1@127.0.0.1:~> ls       
-rw-r--r--    1 1014     1014            0 May 25 01:47 1.txt
-rw-r--r--    1 1014     1014            0 May 25 01:47 2.txt
lftp ftpuser1@127.0.0.1:/> ?
    !<shell-command>                     (commands)                           alias [<name> [<value>]]             attach [PID]
    bookmark [SUBCMD]                    cache [SUBCMD]                       cat [-b] <files>                     cd <rdir>
    chmod [OPTS] mode file...            close [-a]                           [re]cls [opts] [path/][pattern]
    debug [<level>|off] [-o <file>]      du [options] <dirs>                  exit [<code>|bg]
    get [OPTS] <rfile> [-o <lfile>]      glob [OPTS] <cmd> <args>             help [<cmd>]
    history -w file|-r file|-c|-l [cnt]  jobs [-v] [<job_no...>]              kill all|<job_no>                    lcd <ldir>
    lftp [OPTS] <site>                   ln [-s] <file1> <file2>              ls [<args>]
    mget [OPTS] <files>                  mirror [OPTS] [remote [local]]       mkdir [-p] <dirs>
    module name [args]                   more <files>                         mput [OPTS] <files>                  mrm <files>
    mv <file1> <file2>                   [re]nlist [<args>]                   open [OPTS] <site>
    pget [OPTS] <rfile> [-o <lfile>]     put [OPTS] <lfile> [-o <rfile>]      pwd [-p]
    queue [OPTS] [<cmd>]                 quote <cmd>                          repeat [OPTS] [delay] [command]
    rm [-r] [-f] <files>                 rmdir [-f] <dirs>                    scache [<session_no>]
    set [OPT] [<var> [<val>]]            site <site-cmd>                      source <file>
    torrent [-O <dir>] <file|URL>...     user <user|URL> [<pass>]             wait [<jobno>]                       zcat <files>
    zmore <files>
lftp ftpuser1@127.0.0.1:/> 
4.3.2 windows 使用xftp连接ftp服务器
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

5. 使用pure-ftpd搭建ftp服务

5.1 安装pure-ftpd

pure-ftpd软件包是在epel源中,所以安装pure-ftpd需要先安装扩展源:epel

代码语言:javascript
复制
[root@linux-001 vsftpd]# yum install  -y  pure-ftpd
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
pure-ftpd
 * base: mirrors.aliyun.com
 * epel: mirrors.njupt.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 pure-ftpd.x86_64.0.1.0.47-2.el7 将被 安装
--> 正在处理依赖关系 usermode,它被软件包 pure-ftpd-1.0.47-2.el7.x86_64 需要
--> 正在处理依赖关系 libpq.so.5()(64bit),它被软件包 pure-ftpd-1.0.47-2.el7.x86_64 需要
--> 正在检查事务
---> 软件包 postgresql-libs.x86_64.0.9.2.24-1.el7_5 将被 安装
---> 软件包 usermode.x86_64.0.1.111-5.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

====================================================================================================================================
 Package                             架构                       版本                                 源                        大小
====================================================================================================================================
正在安装:
 pure-ftpd                           x86_64                     1.0.47-2.el7                         epel                     263 k
为依赖而安装:
 postgresql-libs                     x86_64                     9.2.24-1.el7_5                       base                     234 k
 usermode                            x86_64                     1.111-5.el7                          base                     193 k

事务概要
====================================================================================================================================
安装  1 软件包 (+2 依赖软件包)

总下载量:690 k
安装大小:2.1 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/3): usermode-1.111-5.el7.x86_64.rpm                                                                       | 193 kB  00:00:00     
(2/3): pure-ftpd-1.0.47-2.el7.x86_64.rpm                                                                     | 263 kB  00:00:03     
(3/3): postgresql-libs-9.2.24-1.el7_5.x86_64.rpm                                                             | 234 kB  00:00:05     
------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                112 kB/s | 690 kB  00:00:06     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : usermode-1.111-5.el7.x86_64                                                                                     1/3 
  正在安装    : postgresql-libs-9.2.24-1.el7_5.x86_64                                                                           2/3 
  正在安装    : pure-ftpd-1.0.47-2.el7.x86_64                                                                                   3/3 
  验证中      : pure-ftpd-1.0.47-2.el7.x86_64                                                                                   1/3 
  验证中      : postgresql-libs-9.2.24-1.el7_5.x86_64                                                                           2/3 
  验证中      : usermode-1.111-5.el7.x86_64                                                                                     3/3 

已安装:
  pure-ftpd.x86_64 0:1.0.47-2.el7                                                                                                   

作为依赖被安装:
  postgresql-libs.x86_64 0:9.2.24-1.el7_5                               usermode.x86_64 0:1.111-5.el7                              

完毕!
[root@linux-001 vsftpd]#

5.2 修改配置文件

vim /etc/pure-ftpd/pure-ftpd.conf//找到pureftpd.pdb这行,把行首的#删除

代码语言:javascript
复制
[root@linux-001 vsftpd]#  vim /etc/pure-ftpd/pure-ftpd.conf/

 PureDB                        /etc/pure-ftpd/pureftpd.pdb

5.3 启动pure-ftpd服务

因为vsftpd和pure-ftpd 共用21端口,因此需要把vsftpd服务关掉,再开启pure-ftpd。

代码语言:javascript
复制
[root@linux-001 vsftpd]# systemctl start pure-ftpd
[root@linux-001 vsftpd]# ps aux | grep pure-ftpd
root 2376 0.0 0.0 202520 1204 ? Ss 14:44 0:00 pure-ftpd (SERVER)
root 2378 0.0 0.0 112720 984 pts/0 S+ 14:44 0:00 grep --color=auto pure-ftpd

5.4 创建ftp家目录和ftp用户

代码语言:javascript
复制
[root@linux-001 vsftpd]# mkdir /data/ftp
[root@linux-001 vsftpd]# useradd -u 1010 pure-ftp
[root@linux-001 vsftpd]# chown -R pure-ftp:pure-ftp /data/ftp

5.5 创建虚拟用户ftp_usera并且生成用户数据

通过pure-pw命令增加ftp用户以及配置用户库文件

代码语言:javascript
复制
 [root@linux-001 vsftpd]# pure-pw useradd ftp_usera -u pure-ftp  -d /data/ftp
 Password: 
Enter it again: 
[root@linux-001 vsftpd]# pure-pw mkdb
[root@linux-001 vsftpd]#

5.6 连接ftp服务

代码语言:javascript
复制
[root@linux-001 vsftpd]#   lftp ftp_usera@127.0.0.1
口令: 
lftp ftp_usera@127.0.0.1:~> ls
drwxr-xr-x 2 1010 pure-ftp 21 Jul 15 14:51 .
drwxr-xr-x 2 1010 pure-ftp 21 Jul 15 14:51 ..
-rw-r--r-- 1 1010 pure-ftp 0 Jul 15 14:51 123.txt
lftp ftp_usera@127.0.0.1:/>
lftp ftp_usera@127.0.0.1:/> quit

课后总结

1.NFS使用场景

NFS网络文件系统适用于5台以内,超过5台得使用场景并不合适,并不支持高并发,访问量比较少。类似于windows系统上得磁盘映射功能。

2.NFS生产环境使用注意事项

  • 由于nfs服务器出现故障,导致php无法读取内容,最终php资源耗尽。而显示502错误。解决方案:卸载掉nfs挂载的磁盘。使访问的资源404。这样可以让php得以释放。
  • 共享文件的高可用方案: 1,rsync + inotify 2,商用nas等方案
  • 绝对不允许使用NFS来解决数据库(如:mysql)的读写。

3.FTP使用场景

FTP使用范围也是小范围,使用比较方便,但是ftp传输得协议是明文,所以不安全。小公司可能会使用ftp来上传文件,正规得方式是使用git代码平台来发布。 SFTP和FTP的区别是:SFTP使用SSH协议。所以更安全。

4.FTP的主动和被动

http://ask.apelearn.com/question/961

主动模式: PORT中文称为主动模式,工作的原理: FTP客户端连接到FTP服务器的21端口,发送用户名和密码登录,登录成功后要list列表或者读取数据时,客户端随机开放一个端口(1024以上),发送 PORT命令到FTP服务器,告诉服务器客户端采用主动模式并开放端口;FTP服务器收到PORT主动模式命令和端口号后,通过服务器的20端口和客户端开放的端口连接,发送数据,原理如下图:

在这里插入图片描述
在这里插入图片描述

被动模式: PASV是Passive的缩写,中文成为被动模式,工作原理:FTP客户端连接到FTP服务器的21端口,发送用户名和密码登录,登录成功后要list列表或者读取数据时,发送PASV命令到FTP服务器, 服务器在本地随机开放一个端口(1024以上),然后把开放的端口告诉客户端, 客户端再连接到服务器开放的端口进行数据传输,原理如下图:

在这里插入图片描述
在这里插入图片描述

从上面的运行原来看到,主动模式和被动模式的不同简单概述为: 主动模式传送数据时是“服务器”连接到“客户端”的端口;被动模式传送数据是“客户端”连接到“服务器”的端口。

主动模式需要客户端必须开放端口给服务器,很多客户端都是在防火墙内,开放端口给FTP服务器访问比较困难。

被动模式只需要服务器端开放端口给客户端连接就行了。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019/05/27 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • NFS文件共享和FTP服务器
  • 预习笔记
    • 1. NFS简介
      • 2. NFS服安装配置
        • 2.1 服务端得安装配置
        • 2.2 客户端挂载nfs
        • 2.3 exportfs命令常用选项
      • 3.NFS客户端属主属组是nobody
        • 3.1 解决方案一
        • 3.2 解决方案二
      • 4. FTP服务器
        • 4.1 FTP服务器简介
        • 4.2 FTP服务器搭建
        • 4.3 连接ftp服务器
      • 5. 使用pure-ftpd搭建ftp服务
        • 5.1 安装pure-ftpd
        • 5.2 修改配置文件
        • 5.3 启动pure-ftpd服务
        • 5.4 创建ftp家目录和ftp用户
        • 5.5 创建虚拟用户ftp_usera并且生成用户数据
        • 5.6 连接ftp服务
    • 课后总结
      • 1.NFS使用场景
        • 2.NFS生产环境使用注意事项
          • 3.FTP使用场景
            • 4.FTP的主动和被动
            相关产品与服务
            访问管理
            访问管理(Cloud Access Management,CAM)可以帮助您安全、便捷地管理对腾讯云服务和资源的访问。您可以使用CAM创建子用户、用户组和角色,并通过策略控制其访问范围。CAM支持用户和角色SSO能力,您可以根据具体管理场景针对性设置企业内用户和腾讯云的互通能力。
            领券
            问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档