用bash脚本中的doveadmvalidationSHA-512散列pw导致“net_connect_unix … permission denied”

我正在尝试使用以下代码validationSHA-512哈希密码:

#!/bin/bash ... pw_verified=$(/usr/bin/doveadm pw -p 'test' -t '{SHA512-CRYPT}$6$rounds=999999$somehash') ... 

bash脚本具有以下权限

 -rwxr-xr-- 1 root dovecot 5793 Jul 25 16:13 checkpassword.sh 

执行脚本后,我在syslog中得到以下内容:

 dovecot: doveadm: Fatal: Error reading configuration: net_connect_unix(/var/run/dovecot/config) failed: Permission denied ###(btw: is it possible to get a more detailed log on this like eg: "Permission denied (euid=65534(nobody) egid=65534(nogroup) missing +r perm: /run/dovecot/auth-worker, dir owned by 0:0 mode=0755))" 

/ var / run / dovecot / config具有以下权限:

 srw------- 1 root root 0 Jul 25 16:58 config 

我试过了

 chmod o+x /var/run/dovecot/config (and chown) 

但重新加载dovecot后重置权限。

在线研究后,我发现我需要在“10-master.conf”中更改一些“服务authentication”设置,这些是我的设置:

 service auth { # auth_socket_path points to this userdb socket by default. It's typically # used by ... DOVEADM, ..........etc unix_listener auth-userdb { #mode = 0666 #user = #group = } } 

我已经尝试改变他们

 service auth { unix_listener auth-userdb { group = vmail #and dovcot mode = 0777 user = vmail #and dovecot } } 

但仍然有相同的权限错误。