加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgresql – postgres的密码

发布时间:2020-12-13 16:29:23 所属栏目:百科 来源:网络整理
导读:在简短版本的postgres安装它告诉我做以下 ./configuregmakesugmake installadduser postgresmkdir /usr/local/pgsql/datachown postgres /usr/local/pgsql/datasu - postgres/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data/usr/local/pgsql/bin/post
在简短版本的postgres安装它告诉我做以下
./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

现在我创建了postgres用户,但它有时会询问该用户的凭据. postgres用户是否有默认密码?为什么我甚至需要制作另一个用户?

What’s the default superuser username/password for postgres after a new install?:

CAUTION The answer about changing the UNIX password for “postgres” through “$sudo passwd postgres” is not preferred,and can even be DANGEROUS!

This is why: By default,the UNIX account “postgres” is locked,which means it cannot be logged in using a password. If you use “sudo passwd postgres”,the account is immediately unlocked. Worse,if you set the password to something weak,like “postgres”,then you are exposed to a great security danger. For example,there are a number of bots out there trying the username/password combo “postgres/postgres” to log into your UNIX system.

What you should do is follow Chris James‘s answer:

06000

To explain it a little bit…

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读