Noob在这里,所以请告诉我这是否很愚蠢。如果标题中的行话稍微有些偏离,也表示歉意。
这是我的问题。我有一个用户,postgres
可用于所有涉及postgres数据库服务器的任务。但是,Permission denied
在postgres中运行脚本时,我经常遇到。我必须不断退出postgres,将某些目录设置为postgres,而且很显然,sudo
在inside时无法运行postgres
。如果我这样做,Ubuntu会给我以下消息:
postgres is not in the sudoers file. This incident will be reported.
淫。如何在postgres中运行sudo或赋予postgres更多权限?
您必须通过运行以下命令将postgres用户添加到sudo组。
sudo usermod -a -G sudo postgres
注销并重新登录生效。
如果上面的命令不起作用,那么您需要放入root shell,然后应用上面的命令。
如何掉入root shell?
root
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句