# Fix Postgres 17 user permissions

**Project:** Servers | **Board:** Live | **Votes:** 1
**URL:** https://roadmap.ploi.io/projects/1-server-level-requests/items/1409-fix-postgres-17-user-permissions

---

Related to https://canary.discord.com/channels/465764339174080512/1277614467399680060

Currently a new server, with a fresh install of postgres 17 (other versions may be impacted) creates users with no permissions. To manually fix: 

```
# log into an account with sudo, likely `ploi`)
ssh ploi@ipaddress

# jump into postgres (you'll need the sudo password)
sudo -u postgres psql

# show your users (make a note of which user you want to use for dbuser below)
\du

# connect to your database(s)
\c databasename

# grant permissions (change dbuser to your user)
GRANT CREATE ON SCHEMA public TO dbuser;
GRANT USAGE ON SCHEMA public TO dbuser;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO dbuser;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO dbuser;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO dbuser;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO dbuser;

### DONE ###
```

This doesn't help any future users, though, as this process will have to be run again for any new users/databases
