安全版V4.5密码加密算法由SM3改为MD5

📅 2026/7/9 6:27:18
安全版V4.5密码加密算法由SM3改为MD5
文章目录环境文档用途详细信息环境系统平台Linux x86-64 Red Hat Enterprise Linux 7版本4.5文档用途本文档用于指导瀚高数据库安全版V4.5的密码加密算法由SM3改为MD5详细信息1、用默认三权用户和普通用户登录数据库修改密码加密算法并更改密码[roothost ~]# 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 [roothost ~]# psql -U syssso -d highgo highgo# set password_encryption md5; highgo# alter user syssso with password xxx; highgo# \q [roothost ~]# psql -U syssao -d highgo highgo# set password_encryption md5; highgo# alter user syssao with password xxx; highgo# \q [roothost ~]# psql -U test -d highgo highgo# set password_encryption md5; highgo# alter user test with password xxx; highgo# \q注普通用户忘记密码时可用管理员用户syssso设置密码。2、更改.pgpass中的密码如未配置.pgpass请忽略此步[roothost ~]# vi ~/.pgpass #hostname:port:database:username:password localhost:5866:highgo:sysdba:xxx3、修改数据目录中的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 md54、重载数据库配置[roothost data]# pg_ctl reload注参数password_encryption为动态参数文件pg_hba可动态修改因此无需重启数据库。