Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Peer authentication failed for user lemmy" #220

Closed
mtekman opened this issue Jun 19, 2023 · 1 comment
Closed

"Peer authentication failed for user lemmy" #220

mtekman opened this issue Jun 19, 2023 · 1 comment

Comments

@mtekman
Copy link
Contributor

mtekman commented Jun 19, 2023

This is an issue to do with the postgresql using peer authentication and not password ("md5") authentication.

Solution

The solution is to create a relevant line in your pg_hba.conf file (usually found in /etc/postgresql/).

Change:

# "local" is for Unix domain socket connections only
local   all             all                                     peer

to:

# "local" is for Unix domain socket connections only
local   lemmy           lemmy                                   md5
local   all             all                                     peer

Or, one liner:

sed -i -r '/^local\s+all\s+all\s+peer/i local lemmy lemmy md5' /etc/postgresql/15/main/pg_hba.conf

Commentary

This ensures that only the "lemmy" database under user "lemmy" accepts passwords.
Note that this new line must be added above the unedited line, in order for it to work.

After this, restart your postgres (sudo systemctl restart postgresql), and things should work

@Nutomic
Copy link
Member

Nutomic commented Jun 26, 2023

#221

@Nutomic Nutomic closed this as completed Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants