【问题标题】:PostgreSQL security and passwordsPostgreSQL 安全性和密码
【发布时间】:2015-08-12 23:32:36
【问题描述】:

我在 PostgreSQL 安全方面遇到了一些问题

我已经采取了必要的步骤

# ./psql -U postgres

# CREATE DATABASE devdb;

# CREATE USER devdb_user PASSWORD 'donttell';

# GRANT ALL PRIVILEGES ON DATABASE devdb TO devdb_user;

但是,当我尝试使用

连接到数据库时
# ./psql -d devdb -U devdb_user -W

它提示我输入密码,但我输入的任何密码仍然会登录。这是为什么呢?

【问题讨论】:

  • 你的意思是./psql -d devdb -U devdb_user -W而不是./psql -d devdb -U devdb_us -W
  • 是的,打错字了,抱歉

标签: postgresql security passwords


【解决方案1】:

哦,我在 pg_hba.conf 中看到它正在读取传入连接作为具有信任身份验证设置的本地连接。改成md5,一切又都收紧了

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-03-25
    • 1970-01-01
    • 2011-02-11
    • 2011-07-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-06
    相关资源
    最近更新 更多