环境
系统平台:Linux x86-64 Red Hat Enterprise Linux 7
版本:4.5
文档用途
本文档用于指导瀚高数据库安全版V4.5的密码加密算法由SM3改为MD5
详细信息
1、用默认三权用户和普通用户登录数据库,修改密码加密算法并更改密码
[root@host ~]# psql -U sysdba -d highgo
highgo=# alter system set password_encryption ='md5';
highgo=# set password_encryption ='md5';
highgo=# alter user sysdba with password 'xxx';
highgo=# \q
[root@host ~]# psql -U syssso -d highgo
highgo=# set password_encryption ='md5';
highgo=# alter user syssso with password 'xxx';
highgo=# \q
[root@host ~]# psql -U syssao -d highgo
highgo=# set password_encryption ='md5';
highgo=# alter user syssao with password 'xxx';
highgo=# \q
[root@host ~]# psql -U test -d highgo
highgo=# set password_encryption ='md5';
highgo=# alter user test with password 'xxx';
highgo=# \q
注:普通用户忘记密码时,可用管理员用户syssso设置密码。
2、更改.pgpass中的密码,如未配置.pgpass请忽略此步
[root@host ~]# vi ~/.pgpass
#hostname:port:database:username:password
localhost:5866:highgo:sysdba:xxx
3、修改数据目录中的pg_hba.conf文件,将sm3改为md5
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections
host all all 127.0.0.1/32 md5
host all all 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all md5
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5
4、重载数据库配置
[root@host data]# pg_ctl reload
注:参数password_encryption为动态参数,文件pg_hba可动态修改,因此无需重启数据库。