db_load 命令的参数

实例:

将用户信息文件转换为数据库并使用hash加密
db_load -T -t hash -f /etc/vsftpd/vftpuser.txt /etc/vsftpd/vftpuser.db

参数:

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命令需要安装 db4-utils这个软件包,在RHEL4.5中,这个软件包在第三个VCD光盘中.
db_load命令几个相关选项:
-T
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允许应用程序能够将文本文件转译载入进数据库。由于我们之后是将虚拟用户的信息以文件方式存储在文件里的,为了让Vsftpd这个应用程序能够通过文本来载入用户数据,必须要使用这个选项。
If the -T option is specified, the underlying access method type must be specified using the -t option.
如果指定了选项-T,那么一定要追跟子选项-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数据库。

-f
参数后面接包含用户名和密码的文本文件,文件的内容是:奇数行用户名、偶数行密码,例如:

huawei

df32342*#@f

yaxin

fsf2342)8^^*32

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/20943428/viewspace-661714/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/20943428/viewspace-661714/

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值