linux - Windows 上为 "sshpass is not recognized"

标签 linux windows ssh sshpass

我想从我的 Windows 运行 sshpass 命令到远程 Linux 服务器。我使用这个命令:

sshpass -p 'password' ssh ldap.nextstep4it.com -l root -o StrictHostKeyChecking=no

但是我的 cmd 返回以下错误语句:

'sshpass' is not recognized as an internal or external command, operable program or batch file.

我认为这是因为 Windows 没有像 Linux 那样的 sshpass 包。在 Linux 中,我必须安装 sshpass 包才能运行此命令。

有人知道如何通过 Windows 命令行运行 sshpass 命令吗?

最佳答案

您不能在 Windows 中运行 sshpass。 但是,您可以通过 Windows 命令行使用 putty 来实现相同的目的。

putty -load "host" -l username -pw password

您还可以使用 WinSCP 通过命令行(使用密码)上传文件

winscp /command "option batch abort" "option confirm off" "open sftp://user:password@example.com/" "put examplefile.txt /home/user/" "exit"

关于linux - Windows 上为 "sshpass is not recognized",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23419659/

相关文章:

windows - 如何在 Windows 上保持 ssh 连接打开并将其与 perl 一起使用?

linux - 用于移动文件及其父目录的 Bash 脚本

linux - 使用标准 shell 构建自定义应用程序特定的 shell

java - 如何在 Windows 操作系统中使用 Runtime.exex() 从单个类的单独命令窗口中调用多个 java 程序?

c - 如何检测键盘上的删除键何时被按下?

c++ - 使用符号构建 Qt 应用程序发布配置

linux - 从Linux中的文件的第一行提取数字

Linux - 查找文件夹更改时间是否大于 2 小时

security - 如何在同一(但不断变化的)IP 地址上处理 2 个不同主机的 ssh 主机 key 验证?

c# - 从 Windows 机器与 SSH session 交互的最简单方法?