如何編輯CentOSvsftpd虛擬用戶文件數據

如何編輯CentOS vsftpd虛擬用戶文件數據,很多新手對此不是很清楚,為了幫助大家解決這個難題,下面小編將為大家詳細講解,有這方面需求的人可以來學習下,希望你能有所收獲。

公司主營業(yè)務:成都網站建設、成都做網站、移動網站開發(fā)等業(yè)務。幫助企業(yè)客戶真正實現互聯網宣傳,提高企業(yè)的競爭能力。成都創(chuàng)新互聯公司是一支青春激揚、勤奮敬業(yè)、活力青春激揚、勤奮敬業(yè)、活力澎湃、和諧高效的團隊。公司秉承以“開放、自由、嚴謹、自律”為核心的企業(yè)文化,感謝他們對我們的高要求,感謝他們從不同領域給我們帶來的挑戰(zhàn),讓我們激情的團隊有機會用頭腦與智慧不斷的給客戶帶來驚喜。成都創(chuàng)新互聯公司推出九原免費做網站回饋大家。

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
需要特別注意的是,以后再要添加虛擬用戶的時候,只需要按照“一行用戶名,一行口令”的格式將新用戶名和口令添加進虛擬用戶名單文件。但是光這樣做還不夠,不會生效的哦!還要再執(zhí)行一遍“ db_load -T -t hash -f 虛擬用戶名單文件CentOS vsftpd虛擬用戶數據庫文件.db ”的命令使其生效才可以!

看完上述內容是否對您有幫助呢?如果還想對相關知識有進一步的了解或閱讀更多相關文章,請關注創(chuàng)新互聯行業(yè)資訊頻道,感謝您對創(chuàng)新互聯的支持。

網頁題目:如何編輯CentOSvsftpd虛擬用戶文件數據
分享URL:http://muchs.cn/article36/gppppg.html

成都網站建設公司_創(chuàng)新互聯,為您提供網頁設計公司、定制開發(fā)手機網站建設、商城網站、、外貿網站建設

廣告

聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯

成都做網站