编辑CentOS vsftpd虚拟用户文件数据

系统 Linux
编辑这个CentOS vsftpd虚拟用户名单文件,在其中加入用户的用户名和口令信息。格式很简单:“一行用户名,一行口令”。

特别值得一提的是CentOS vsftpd虚拟用户有很多值得学习的地方,这里我们主要介绍建立CentOS vsftpd虚拟用户,包括介绍CentOS vsftpd虚拟用户数据库文件等方面。

1.先建立CentOS vsftpd虚拟用户名单文件:
[root@KcentOS5 ~]# touch /etc/vsftpd/virtusers
建立了一个虚拟用户名单文件,这个文件就是来记录CentOS vsftpd虚拟用户的用户名和口令的数据文件,我这里给它命名为virtusers。为了避免文件的混乱,我把这个名单文件就放置在/etc/vsftpd/下。

2.编辑CentOS vsftpd虚拟用户名单文件:
[root@KcentOS5 ~]# vi /etc/vsftpd/virtusers
near
123456near
mello
123456mello
编辑这个CentOS vsftpd虚拟用户名单文件,在其中加入用户的用户名和口令信息。格式很简单:“一行用户名,一行口令”。

3.生成虚拟用户数据文件:
[root@KcentOS5 ~]# db_load -T -t hash -f /etc/vsftpd/virtusers /etc/vsftpd/virtusers.db
这里我顺便把这个命令简单说明一下
察看db4的db_load命令使用方法:
[root@KSRV2 vsftpd]# db_load
usage: db_load [-nTV] [-c name=value] [-f file]
[-h home] [-P password] [-t btree | hash | recno | queue] db_file
usage: db_load -r lsn | fileid [-h home] [-P password] db_file
解释在本篇中,db_load命令几个相关选项很参数

The -T option allows non-Berkeley DB applications to easily load text files into databases.
If the database to be created is of type Btree or Hash, or the keyword keys is specified as set, the input must be paired
lines of text, where the first line of the pair is the key item, and the second line of the pair is its corresponding data
item. If the database to be created is of type Queue or Recno and the keywork keys is not set, the input must be lines of text, where each line is a new data item for the database.
选项-T允许应用程序能够将文本文件转译载入进数据库。由于我们之后是将CentOS vsftpd虚拟用户的信息以文件方式存储在文件里的,为了让Vsftpd这个
应用程序能够通过文本来载入用户数据,必须要使用这个选项。
If the -T option is specified, the underlying access method type must be specified using the -t option.
如果指定了选项-T,那么一定要追跟子选项-t

Specify the underlying access method. If no -t option is specified, the database will be loaded into a database of the same type as was dumped; for example, a Hash database will be created if a Hash database was dumped.
Btree and Hash databases may be converted from one to the other. Queue and Recno databases may be converted from one to the other. If the -k option was specified on the call to db_dump then Queue and Recno databases may be converted to Btree or Hash, with the key being the integer record number.
子选项-t,追加在在-T选项后,用来指定转译载入的数据库类型。扩展介绍下,-t可以指定的数据类型有Btree、Hash、Queue和Recon数据库。这里,接下来我们需要指定的是Hash型。

4.察看生成的CentOS vsftpd虚拟用户数据文件
[root@KcentOS5 ~]# ll /etc/vsftpd/virtusers.db
-rw-r--r-- 1 root root 12288 Sep 16 03:51 /etc/vsftpd/virtusers.db
需要特别注意的是,以后再要添加虚拟用户的时候,只需要按照“一行用户名,一行口令”的格式将新用户名和口令添加进虚拟用户名单文件。但是光这样做还不够,不会生效的哦!还要再执行一遍“ db_load -T -t hash -f 虚拟用户名单文件CentOS vsftpd虚拟用户数据库文件.db ”的命令使其生效才可以!

【编辑推荐】

  1. CentOS Vsftpd配置文件服务调整
  2. 简介CentOS vsftpd使用安装与配置问题
  3. minicom软件在CentOS系统中使用
  4. CentOS vsftp系统帐户安装建立
  5. Centos设置静态IP及修改Centos配置文件
责任编辑:佚名 来源: csdn
相关推荐

2010-02-22 18:27:14

CentOS vsft

2010-02-22 17:07:16

CentOS vsft

2010-01-13 16:13:38

centos vsft

2011-02-24 09:14:37

vsFTPd虚拟用户

2011-03-04 10:05:10

Vsftpd虚拟用户

2011-03-04 14:47:58

Vsftpd虚拟用户

2011-03-03 17:02:50

Vsftpd

2010-12-27 13:26:25

FreeBSDvsftpd虚拟用户

2010-02-04 13:43:26

Linux vsFTP

2011-02-21 17:32:37

Vsftpd

2010-07-01 13:29:08

vsftpd

2010-01-14 17:44:17

CentOS vsft

2010-02-22 17:45:50

CentOS VSFT

2010-01-13 13:50:53

CentOS Vsft

2011-08-23 17:26:05

2017-05-23 14:56:49

MySQLvsftpd虚拟用户

2010-05-20 12:57:38

2015-08-25 14:34:20

LinuxvsftpdFTP

2011-03-04 09:59:41

Vsftpd匿名用户

2011-03-04 13:26:08

Vsftpd虚拟账号
点赞
收藏

51CTO技术栈公众号