Postgresql 未连接到 msf 和 armitage 等任何东西

Postgresql 未连接到 msf 和 armitage 等任何东西

我目前正在运行 Kali Linux,突然间 postgresql 停止了连接。

我的输出msfconsole

Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?

我在网上查找了所有可以找到的解决方案,但没有找到任何答案。

我的 pg_hba.conf 文件是这里

我的 metasploit database.yml 文件是这里

我已经多次重新安装了 postgresql,也停止并启动了该服务。如果您需要我附加更多文件或需要更多信息,请告诉我。提前致谢。

答案1

如果您需要设置 postgresql 并且认为您搞砸了它,请通过 apt purge 清除它并重新安装。然后要做的第一件事是以 postgres 用户身份连接。CD 进入/usr/lib/postgresql/9.5/bin并启动./initdb -D /var/lib/postgresql/9.5/main/

仍然以 postgres 用户身份,创建一个新的数据库和用户createdb msf,,createuser msf然后启动服务器./pg_ctl -D /var/lib/postgresql/9.5/main/ start

完成后,你可以使用自己的帐户登录并启动 metasploit 框架,你应该能够以以下方式连接:[电子邮件保护]:5432/无国界医生

相关内容