python调用 plink.exe returned non-zero exit status 127.
时间: 2023-09-21 07:08:30 浏览: 46
这个错误通常表示 Python 无法找到 plink.exe 或者 plink.exe 文件无法被正确执行。请确保 plink.exe 存在于你的系统 PATH 环境变量中,并且你有足够的权限运行它。你可以在命令行中尝试手动执行 plink.exe,以检查它是否能够正确执行。如果你仍然无法解决问题,请提供更多的错误信息和上下文,以便我能够更好地帮助你。
相关问题
python调用 plink.exe 运行时 Access granted. Press Return to begin session. 如何跳过
您可以使用 Python 的 `subprocess` 模块来运行 `plink.exe` 命令,并将 `-batch` 参数传递给它来跳过交互式提示。以下是示例代码:
```python
import subprocess
command = 'plink.exe -batch your-ssh-command'
output = subprocess.getoutput(command)
```
请注意,这将完全自动化 `plink.exe` 命令,因此如果需要输入密码或其他交互式输入,则可能会出现问题。此外,您可能需要在命令中传递其他参数,以便正确连接到 SSH 服务器。
plink.exe get的使用方法
`plink.exe` 是 PuTTY 工具集中的一个命令行工具,它允许您在 Windows 系统上通过 SSH 连接到远程服务器。`plink.exe get` 命令用于从远程服务器中下载文件。下面是 `plink.exe get` 命令的基本用法:
```
plink.exe -ssh username@remotehost -pw password get /path/to/remote/file C:\path\to\local\file
```
其中,`username` 是您在远程服务器上的用户名,`remotehost` 是远程服务器的地址或主机名,`password` 是您在远程服务器上的密码。`/path/to/remote/file` 是远程服务器上要下载的文件的路径,`C:\path\to\local\file` 是要将文件下载到的本地路径。请注意,`plink.exe` 必须在您的计算机上可用,并且您必须已经具有从远程服务器下载文件的权限。
如果您使用的是 SSH 密钥而不是密码进行身份验证,则可以使用 `-i` 选项指定私钥文件的路径,例如:
```
plink.exe -ssh username@remotehost -i C:\path\to\private\key get /path/to/remote/file C:\path\to\local\file
```
这样 `plink.exe` 就会使用指定的私钥文件进行身份验证。