VCSA内置PG数据库信息

vcsa就是一个suse linux,会内置一个PostgreSQL数据库,那么如何修改数据库用户密码呢?
首先通过22端口远程连入suse linux

To escape to local shell, press Ctrl+Alt+].

VMware vCenter Server 7.0.3.01500

Type: vCenter Server with an embedded Platform Services Controller

WARNING! The remote SSH server rejected X11 forwarding request.
Last login: Thu Jun 29 01:07:17 2023 from 192.168.21.175
Connected to service

    * List APIs: "help api list"
    * List Plugins: "help pi list"
    * Launch BASH: "shell"

Command>

首先输入shell就来到了熟悉的linux命令行。
Command> shell
Shell access is granted to root
root@vcsa7 [ ~ ]#




其次查看下vc连库的密码:
root@vcsa7 [ ~ ]# cat /etc/vmware-vpx/vcdb.properties
driver = org.postgresql.Driver
dbtype = PostgreSQL
url = jdbc:postgresql://localhost:5432/VCDB?sslmode=disable
username = vc
password = 4Zj#S^qyY{oi9}!7
password.encrypted = false




可以看到密码是明文,直接修改即可,也可打开下面的encrypted,密码就变为加密的乱码了。
root@vcsa7 [ ~ ]# psql -U vc -d postgres -W
Password for user vc:
psql (10.22, server 13.8 (VMware Postgres 13.8.0-20449095 release))
WARNING: psql major version 10, server major version 13.
         Some psql features might not work.
Type "help" for help.

postgres=>
postgres=> \pset border 2;
Border style is 2.
postgres=> select version();
+--------------------------------------------------------------------------------------------------------------------------------------------+
|                                                                  version                                                                   |
+--------------------------------------------------------------------------------------------------------------------------------------------+
| PostgreSQL 13.8 (VMware Postgres 13.8.0-20449095 release) on x86_64-pc-linux-gnu, compiled by x86_64-vmk-linux-gnu-gcc (GCC) 6.4.0, 64-bit |
+--------------------------------------------------------------------------------------------------------------------------------------------+
(1 row)

postgres=>
postgres=> \l
                                   List of databases
+-----------+----------+----------+-------------+-------------+-----------------------+
|   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   |
+-----------+----------+----------+-------------+-------------+-----------------------+
| VCDB      | vc       | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/vc               +|
|           |          |          |             |             | vc=CTc/vc            +|
|           |          |          |             |             | vlcmuser=Tc/vc       +|
|           |          |          |             |             | vstatsuser=Tc/vc      |
| postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       |
| template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +|
|           |          |          |             |             | postgres=CTc/postgres |
| template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +|
|           |          |          |             |             | postgres=CTc/postgres |
+-----------+----------+----------+-------------+-------------+-----------------------+
(4 rows)

postgres=> \du
                                      List of roles
+------------+------------------------------------------------------------+--------------+
| Role name  |                         Attributes                         |  Member of   |
+------------+------------------------------------------------------------+--------------+
| archiver   | Replication                                                | {}           |
| cns        |                                                            | {}           |
| hdcsuser   |                                                            | {}           |
| postgres   | Superuser, Create role, Create DB, Replication, Bypass RLS | {}           |
| replicator | Replication                                                | {}           |
| vc         |                                                            | {}           |
| vlcmuser   |                                                            | {pg_monitor} |
| vstatsuser |                                                            | {}           |
| vumuser    |                                                            | {}           |
| wcpuser    |                                                            | {}           |
+------------+------------------------------------------------------------+--------------+

postgres=>


















posted @ 2023-06-29 14:05  花之旭  阅读(180)  评论(0编辑  收藏  举报