菜鸟在这里,所以请告诉我这是否愚蠢。如果标题中的行话有点不对,也很抱歉。
这是我的问题。我有一个用户,postgres用于涉及 postgres 数据库服务器的所有任务。但是,我Permission denied在 postgres 中运行脚本时经常遇到问题。我必须不断地退出 postgres,将某些目录切换到 postgres,而且,显然,sudo在postgres. 如果我这样做 Ubuntu 会给我这条消息:
postgres is not in the sudoers file. This incident will be reported.
Run Code Online (Sandbox Code Playgroud)
淫。如何在 postgres 中运行 sudo 或赋予 postgres 更多权限?
您必须通过运行以下命令将 postgres 用户添加到 sudo 组。
sudo usermod -a -G sudo postgres
Run Code Online (Sandbox Code Playgroud)
注销并重新登录以生效。
如果上面的命令不起作用,那么你需要进入 root shell,然后应用上面的命令..
如何进入root shell?
root| 归档时间: |
|
| 查看次数: |
30962 次 |
| 最近记录: |