時間:2024-03-12 20:33作者:下載吧人氣:21
大家都知道防火墻主要是用來過濾客戶端并保護服務器不被惡意訪問攻擊,那在pg中同樣存在一個類似于防火墻的工具用來控制客戶端的訪問,也就是pg_hba.conf這個東東。
在initdb初始化數據文件時,默認提供pg_hba.conf. 通過配置該文件,能夠指定哪些ip可以訪問,哪些ip不可以訪問,以及訪問的資源和認證方式,該文件類似于oracle中的監聽中的白名單黑名單功能,且同樣可以reload在線生效。
local database user auth-method [auth-options]
host database user address auth-method [auth-options]
hostssl database user address auth-method [auth-options]
hostnossl database user address auth-method [auth-options]
host database user IP-address IP-mask auth-method [auth-options]
hostssl database user IP-address IP-mask auth-method [auth-options]
hostnossl database user IP-address IP-mask auth-method [auth-options]
網友評論