PgAdmin 4 - How to connect to database via ssh tunnel as posgres when its password is empty?
Does user postgres have to have a password if I want to connect via SSH tunnel? Is it possible? And what should I do in order to connect?


Generally it does.

Your SSH tunnel is configured so that the remote SSH server connects to PostgreSQL through a TCP connection to localhost. And generally, a default pg_hba.conf maps this type of connection to the md5 authentication scheme, for which a password is required. Otherwise any user with a shell account could connect to PostgreSQL, which would be wrong as a default configuration.

The more common way to use PostgreSQL through a SSH tunnel is to set a password to the PostgreSQL databases accounts that you need to connect to. Use the \password command inside psql or the ALTER USER SQL statement.