inchTodd/db-error-troubleshooting-skills / skills/pg-peer-authentication-failed
pg-peer-authentication-failed
Verified排查 PostgreSQL 报错「Peer authentication failed for user "%s"」。当用户贴出包含这条报错的输出、或问这条报错怎么解决时使用。只读排查优先,不需要也不收集数据库密码。
Security report
VerifiedStatic analysis of one exact version. It reduces risk and shows evidence; it does not certify that a skill is safe.
- Commit
2ff693518fb96472dbf425728458e44380d89f2d- Content hash
32938aee5ee979d87191d58092743f6f96c357e62215617ae97bb375de309472- Scanned
- 2026-11-17
- Scanner version
- skillxone-scan-1.0.0
- Policy version
- 0.1-draft
- Decision
- Every required check completed with no open blocking or medium findings.
- Verification expires
- 2026-12-17
Findings (4 low)
A command runs with administrator privileges.
这条报错说明连接命中了 `pg_hba.conf` 里一条 `local ... peer` 规则:peer 方式会从内核取**当前操作系统用户名**,要求它和你要登录的数据库用户名一致。用 Linux 用户 `ubuntu` 执行 `psql -U postgres` 就会失败。最快的改法是 `sudo -u postgres psql`;应用要用密码登录时,改走 TCP(`-h 127.0.0.1`)或把那条 local 规则改成 `scram-sha-256`。Suggested fix: Avoid sudo where possible. If it is required, explain why so the user can decide.
A command runs with administrator privileges.
| `sudo psql -U postgres` | `root` | `postgres` | 失败:sudo 后是 root |Suggested fix: Avoid sudo where possible. If it is required, explain why so the user can decide.
A command runs with administrator privileges.
sudo -u postgres psqlSuggested fix: Avoid sudo where possible. If it is required, explain why so the user can decide.
A command runs with administrator privileges.
**为什么 sudo psql -U postgres 也不行?**Suggested fix: Avoid sudo where possible. If it is required, explain why so the user can decide.
Checks run
- prompt-injection
- dangerous-commands
- credentials
- network
- file-access
- integrity
Checks skipped
- dependencies: No dependency manifest in the skill directory.
- gitleaks: gitleaks is not installed on this host.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| Agent Cost Reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |