首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >sshpass在高寒linux中不起作用

sshpass在高寒linux中不起作用
EN

Unix & Linux用户
提问于 2018-01-16 02:45:20
回答 2查看 12.5K关注 0票数 5

当我在高寒linux上安装sshpass时,它会安装,如果没有参数运行,那么文档将显示出来,但是使用任何参数(有效或无效)都会返回sshpass: Failed to run command: No such file or directory

它是路径的,即使在使用绝对路径时,它也有相同的行为。我想和ansible一起使用它,但是它甚至不能直接工作。

我似乎在网上找不到任何关于这个功能的信息,或者没有对其他人起作用,但是我使用了别人的容器和我自己的容器,我也无法让它在其中发挥作用。https://pkgs.alpinelinux.org/package/v3.3/main/x86/sshpass

代码语言:javascript
复制
$ 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可执行文件可以工作,我可以通过这种方式连接到主机。

EN

回答 2

Unix & Linux用户

回答已采纳

发布于 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来解决的。

票数 13
EN

Unix & Linux用户

发布于 2018-01-16 03:29:11

No such file or directory是指hianyinput :)

我刚在一个高山虚拟机上安装了sshpass

代码语言:javascript
复制
# sshpass -p <my password> ssh 127.0.0.1

按预期工作。

PS:我相信你知道你在做什么,但请确保你在获取sshpass这样的东西之前,已经查看过公钥认证。

票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/417405

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档