Cannot login to postgres with newly created users I have created a number of users in postgres using createuser --interactive --password but whenever I run sudo -i -u newuser I receive the following error:

sudo: unknown user: staging
sudo: unable to initialize policy plugin


I then checked the user list when using the default postgres user to see if there were in fact any other users. It returned the following:

List of roles
 Role name |                   Attributes                   | Member of
-----------+------------------------------------------------+-----------
 newuser   | Superuser, Create role, Create DB              | {}
 newuser2  | Superuser, Create role, Create DB              | {}
 newuser3  | Superuser, Create role, Create DB, Replication | {}
 postgres  | Superuser, Create role, Create DB, Replication | {}

So I know that they are there. Why is it failing?

My end goal is to use this local db as my database for my deployed server. They are both installed on the same vm and I just want the REST calls from my server to interact with the local database, which I assume should be no problem, if I could ever connect to it.
2 things were required to solve this problem

service postgresql reload and I had to give postgres a password.
Unaware how to connect externally without a password but I wouldn't want to anyways so not concerned about it.

I also failed to have a new user function properly, only the default one worked. But it does work now.