Python脚本以root身份运行权限被拒绝

时间:2016-11-06 20:01:29

标签: python-2.7 debian qmail

我在debian 8上配置tmda。我正在以root身份运行tmda-filter.py。 此脚本读取密钥文件。它坚持是CHMOD 400或600.脚本从/ package / tmda-fork / tmda / bin / tmda-filter属于 ROOT:ROOT     关键是ROOT所拥有的/vpopmail/domains/.tmda/crypt_key:ROOT

Traceback (most recent call last):
File "/package/tmda-fork/tmda/bin/tmda-filter", line 50, in <module>
execfile(os.path.join(execdir, 'tmda-rfilter'))
File "/package/tmda-fork/tmda/bin/tmda-rfilter", line 164, in <module>
from TMDA import Defaults
File "/package/tmda-fork/tmda/TMDA/Defaults.py", line 1753, in       <module>
CRYPT_KEY = binascii.unhexlify(open(CRYPT_KEY_FILE).read().strip())
IOError: [Errno 13] Permission denied:     '/home/vpopmail/domains/mydomain.com/.tmda/crypt_key'

1 个答案:

答案 0 :(得分:0)

将密钥文件的所有者更改为目录所有者并执行。 chown vpopmail:vchkpw