gpt4 book ai didi

python - 通过 python cgi 脚本的 ssh 不工作

转载 作者:太空宇宙 更新时间:2023-11-04 12:45:57 24 4
gpt4 key购买 nike

我有几件事要问。我在尝试从 python CGI ssh 远程主机时遇到以下错误。

Could not create directory '/var/www/.ssh'.
Failed to add the RSA host key for IP address '17.172.221.39' to the list of known hosts (/var/www/.ssh/known_hosts).
Permission denied (gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive).

这是因为它没有使用我的密码还是因为 apache eing 用户和 ssh 是不允许的...

如何确保 ssh 发生而无需在所有主机上为此执行 ssh key 启动。

我如何以 root 用户而不是以 apache 用户运行 cgi 脚本。我只需要以 root 身份运行几个脚本。我不能使用 SuExec 等。请提供解决我面临的这两个问题的方法

最佳答案

Web 服务器进程由 apache 用户拥有,而不是 root。

  1. 确保 apache 用户使用密码访问其他服务器
  2. 应该禁用 SELinux

引用:http://wccandlinux.blogspot.in/2016/07/how-to-run-ssh-command-from-apache.html

关于python - 通过 python cgi 脚本的 ssh 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38732098/

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