亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪(fǎng)問(wèn)板塊 發(fā)新帖
查看: 19377 | 回復(fù): 5
打印 上一主題 下一主題

問(wèn)問(wèn)PostgreSQL的登錄過(guò)程。 [復(fù)制鏈接]

論壇徽章:
89
水瓶座
日期:2014-04-01 08:53:31天蝎座
日期:2014-04-01 08:53:53天秤座
日期:2014-04-01 08:54:02射手座
日期:2014-04-01 08:54:15子鼠
日期:2014-04-01 08:55:35辰龍
日期:2014-04-01 08:56:36未羊
日期:2014-04-01 08:56:27戌狗
日期:2014-04-01 08:56:13亥豬
日期:2014-04-01 08:56:02亥豬
日期:2014-04-08 08:38:58程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2016-01-05 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2016-01-07 06:20:00
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2013-08-28 21:56 |只看該作者 |倒序?yàn)g覽
本帖最后由 fender0107401 于 2013-08-28 22:01 編輯

首先有個(gè)疑問(wèn)就是pg_hba.conf這個(gè)文件。

我的理解是這個(gè)文件基本上算是一個(gè)PostgreSQL自帶的防火墻,可以對(duì)ip、用戶(hù)名、數(shù)據(jù)庫(kù)以及認(rèn)證方式進(jìn)行限制。

如果一個(gè)用戶(hù)連接數(shù)據(jù)庫(kù),那么 這個(gè)用戶(hù)的客戶(hù)端程序應(yīng)該是先通過(guò)pg_hba.conf這個(gè)文件。

如果數(shù)據(jù)庫(kù)的管理員創(chuàng)建role的時(shí)候,設(shè)定了用戶(hù)的密碼,那么這個(gè)密碼應(yīng)該是md5(我猜測(cè)的,沒(méi)找到具體文檔)存在數(shù)據(jù)庫(kù)內(nèi)部。

如果一個(gè)用戶(hù)連接數(shù)據(jù)庫(kù),并且通過(guò)了pg_hba.conf文件的認(rèn)證

問(wèn)題1:假設(shè)pg_hba.conf文件里面設(shè)定的是password,那么會(huì)發(fā)生什么?用戶(hù)的用戶(hù)名和密碼直接交給數(shù)據(jù)庫(kù)服務(wù)器進(jìn)程?然后校驗(yàn)?

問(wèn)題2:假設(shè)pg_hba.conf文件里面設(shè)定的是md5,那么會(huì)發(fā)生什么?難道直接就把密碼給翻譯成md5之后的密文了嗎?然后交給數(shù)據(jù)庫(kù)服務(wù)器進(jìn)程進(jìn)行校驗(yàn)?

問(wèn)題3:pg_hba.conf文件里面的password和md5選項(xiàng)應(yīng)該不會(huì)影響到數(shù)據(jù)庫(kù)里面保存密碼的具體方式吧(我猜是md5加密后的密文)。

先問(wèn)這么多,開(kāi)始認(rèn)真學(xué)PostgreSQL了。

之前發(fā)現(xiàn)PostgreSQL支持好多數(shù)據(jù)類(lèi)型,感覺(jué)很牛逼,現(xiàn)在仔細(xì)學(xué)學(xué),感覺(jué)更牛逼了。

論壇徽章:
89
水瓶座
日期:2014-04-01 08:53:31天蝎座
日期:2014-04-01 08:53:53天秤座
日期:2014-04-01 08:54:02射手座
日期:2014-04-01 08:54:15子鼠
日期:2014-04-01 08:55:35辰龍
日期:2014-04-01 08:56:36未羊
日期:2014-04-01 08:56:27戌狗
日期:2014-04-01 08:56:13亥豬
日期:2014-04-01 08:56:02亥豬
日期:2014-04-08 08:38:58程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2016-01-05 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2016-01-07 06:20:00
2 [報(bào)告]
發(fā)表于 2013-08-29 08:16 |只看該作者
本帖最后由 fender0107401 于 2013-08-29 08:16 編輯

如果使用其他認(rèn)證方式,不使用password和md5,那么是如何確認(rèn)用戶(hù)身份的呢?

誰(shuí)來(lái)指點(diǎn)一下大致的流程,感激不盡。

論壇徽章:
2
亥豬
日期:2014-03-19 16:36:35午馬
日期:2014-11-23 23:48:46
3 [報(bào)告]
發(fā)表于 2013-08-29 12:09 來(lái)自手機(jī) |只看該作者
3336901加群

論壇徽章:
89
水瓶座
日期:2014-04-01 08:53:31天蝎座
日期:2014-04-01 08:53:53天秤座
日期:2014-04-01 08:54:02射手座
日期:2014-04-01 08:54:15子鼠
日期:2014-04-01 08:55:35辰龍
日期:2014-04-01 08:56:36未羊
日期:2014-04-01 08:56:27戌狗
日期:2014-04-01 08:56:13亥豬
日期:2014-04-01 08:56:02亥豬
日期:2014-04-08 08:38:58程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2016-01-05 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2016-01-07 06:20:00
4 [報(bào)告]
發(fā)表于 2013-08-29 13:19 |只看該作者
本帖最后由 fender0107401 于 2013-08-29 13:19 編輯

回復(fù) 3# gvim

QQ群?好,我有空試試。


   

論壇徽章:
0
5 [報(bào)告]
發(fā)表于 2013-12-17 16:00 |只看該作者
gvim 發(fā)表于 2013-08-29 12:09
3336901加群


已加。

論壇徽章:
2
青銅圣斗士
日期:2015-11-26 06:15:59數(shù)據(jù)庫(kù)技術(shù)版塊每日發(fā)帖之星
日期:2016-07-24 06:20:00
6 [報(bào)告]
發(fā)表于 2014-03-28 22:40 |只看該作者
Start-up
To begin a session, a frontend opens a connection to the server and sends a startup message. This message includes the names of the user and of the database the user wants to connect to; it also identifies the particular protocol version to be used. (Optionally, the startup message can include additional settings for run-time parameters.)

連接一開(kāi)始只發(fā)送了用戶(hù)名和數(shù)據(jù)庫(kù)名,并沒(méi)有發(fā)送密碼。
client不能選擇認(rèn)證方式,也不知道密碼是否被需要(比如trust,peer,ident等等)。

The server then uses this information and the contents of its configuration files (such as pg_hba.conf) to determine whether the connection is provisionally acceptable, and what additional authentication is required (if any).

server根據(jù)這些信息以及配置來(lái)選擇是否需要認(rèn)證,以及應(yīng)該使用哪種認(rèn)證方式。

AuthenticationCleartextPassword
    The frontend must now send a PasswordMessage containing the password in clear-text form. If this is the correct password, the server responds with an AuthenticationOk, otherwise it responds with an ErrorResponse.
AuthenticationMD5Password
    The frontend must now send a PasswordMessage containing the password encrypted via MD5, using the 4-character salt specified in the AuthenticationMD5Password message. If this is the correct password, the server responds with an AuthenticationOk, otherwise it responds with an ErrorResponse.

于是server就可以查詢(xún)hba并根據(jù)md5或password發(fā)送不同的認(rèn)證請(qǐng)求(或者根本就不需要認(rèn)證請(qǐng)求)。
這時(shí)候client再選擇密碼傳輸?shù)姆绞健?br />
相關(guān)資料:
Password Authentication
Message Formats
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專(zhuān)區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過(guò)ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP