this post was submitted on 10 Jun 2023
6 points (100.0% liked)

Lemmy Support

4634 readers
11 users here now

Support / questions about Lemmy.

Matrix Space: #lemmy-space

founded 5 years ago
MODERATORS
 

I was trying to figure out how to do this, there's no easy way but there is at least a way.

Login to your server, execute the following commands:

(Use sudo for docker if it gives a permission error. If you manually installed, well I'm sure you can figure it out then lmao)

docker ps

From the output of that find the name of the docker container running Postgres.

docker exec -it DOCKER_NAME_HERE bash

psql -U lemmy -h 127.0.0.1 -p 5432 -d lemmy

\c lemmy

SELECT name from person WHERE local='t';

You can also do name,display_name instead of just "name" in the comment above to see their custom display name.

Hope this helps someone.

top 6 comments
sorted by: hot top controversial new old
[–] slashzero@hakbox.social 2 points 1 year ago* (last edited 1 year ago) (2 children)

You can add the docker group to your user, then log out an in again, and you erring need studio anymore for docker commands.

sudo usermod -aG docker your_user

Thanks for this tip, by the way.

[–] bdonvr@lemmy.rogers-net.com 1 points 1 year ago (1 children)

Yeah, I do that on my home server but my VPS had passwordless sudo by default so I was too lazy to do this.

[–] slashzero@hakbox.social 1 points 1 year ago (1 children)

Fair enough. New “sysadmins” might not know that though, so I thought I’d share that tip.

Not a criticism in any way, but I would also recommend not using the default user name and password for the Postgres DB. 😃

[–] bdonvr@lemmy.rogers-net.com 1 points 1 year ago

Heh. Username is default but isn't the password defined in the docker file? That's not default.

[–] example@reddthat.com 1 points 1 year ago

keep in mind that this effectively grants your user passwordless sudo permissions, which may not be what you want.

[–] footkaput@footkaput.com 2 points 1 year ago* (last edited 1 year ago)

thank you!

Would be nice to see some more UI built-in admins tools for user admin.

load more comments
view more: next ›