gpt4 book ai didi

python 织物: put() results in permission denied

转载 作者:行者123 更新时间:2023-12-01 02:29:39 25 4
gpt4 key购买 nike

我使用布料并且有:

put('/projects/configuration-management/prototype','/etc/nginx/sites-available')

结果是:

Underlying exception:
Permission denied

Aborting.

其他配置文件可以轻松上传。我怎样才能避免我的问题?

最佳答案

看起来您需要 super 用户权限,使用 sudo 运行它,它会正常工作

在文档 ( link here ) 中说:

While the SFTP protocol (which put uses) has no direct ability to upload files to locations not owned by the connecting user, you may specify use_sudo=True to work around this. When set, this setting causes put to upload the local files to a temporary location on the remote end (defaults to remote user’s $HOME; this may be overridden via temp_dir), and then use sudo to move them to remote_path.

关于 python 织物: put() results in permission denied,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46981928/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com