当我在高寒linux上安装sshpass时,它会安装,如果没有参数运行,那么文档将显示出来,但是使用任何参数(有效或无效)都会返回sshpass: Failed to run command: No such file or directory。
它是路径的,即使在使用绝对路径时,它也有相同的行为。我想和ansible一起使用它,但是它甚至不能直接工作。
我似乎在网上找不到任何关于这个功能的信息,或者没有对其他人起作用,但是我使用了别人的容器和我自己的容器,我也无法让它在其中发挥作用。https://pkgs.alpinelinux.org/package/v3.3/main/x86/sshpass
$ docker run -it --rm williamyeh/ansible:alpine3 ash
/ # sshpass
Usage: sshpass [-f|-d|-p|-e] [-hV] command parameters
-f filename Take password to use from file
-d number Use number as file descriptor for getting password
-p password Provide password as argument (security unwise)
-e Password is passed as env-var "SSHPASS"
With no parameters - password will be taken from stdin
-P prompt Which string should sshpass search for to detect a password prompt
-v Be verbose about what you're doing
-h Show help (this screen)
-V Print version information
At most one of -f, -d, -p or -e should be used
/ # sshpass hi
sshpass: Failed to run command: No such file or directory
/ # which sshpass
/usr/bin/sshpass
/ # /usr/bin/sshpass
Usage: sshpass [-f|-d|-p|-e] [-hV] command parameters
-f filename Take password to use from file
-d number Use number as file descriptor for getting password
-p password Provide password as argument (security unwise)
-e Password is passed as env-var "SSHPASS"
With no parameters - password will be taken from stdin
-P prompt Which string should sshpass search for to detect a password prompt
-v Be verbose about what you're doing
-h Show help (this screen)
-V Print version information
At most one of -f, -d, -p or -e should be used
/ # /usr/bin/sshpass anyinput
sshpass: Failed to run command: No such file or directory值得一提的是,底层的ssh可执行文件可以工作,我可以通过这种方式连接到主机。
发布于 2018-01-17 02:25:22
SSHpass运行良好,但是高寒容器python:3.6没有安装openssh。
这条错误消息令人困惑,因为它没有提到ssh组件正在失败。
可以通过运行apk add --update openssh来解决这个问题。
这是通过将Dockerfile中的行从RUN apk add --update --no-cache sshpass更改为RUN apk add --update --no-cache openssh sshpass来解决的。
发布于 2018-01-16 03:29:11
No such file or directory是指hi和anyinput :)
我刚在一个高山虚拟机上安装了sshpass
# sshpass -p <my password> ssh 127.0.0.1按预期工作。
PS:我相信你知道你在做什么,但请确保你在获取sshpass这样的东西之前,已经查看过公钥认证。
https://unix.stackexchange.com/questions/417405
复制相似问题