在CentOS版本6.3 (最终版)系统上工作。并尝试使用sshpass实用程序ssh另一台机器,例如
sshpass -p 'password' ssh user@host但是它会给我错误,比如
sshpass: Failed to run command: No such file or directory因此,由于错误,我认为sshpass可能没有安装,所以我尝试通过yum install sshpass安装它,并获得以下日志
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirror.leapswitch.com
* epel: epel.mirror.net.in
* extras: mirror.leapswitch.com
* nux-libreoffice.org-rpms: mirror.li.nux.ro
* updates: mirror.leapswitch.com
Setting up Install Process
Package sshpass-1.05-1.el6.i686 already installed and latest version
Nothing to do从上面看,sshpass已经是installed.So了,为什么它不能工作呢?
发布于 2014-01-27 15:39:52
检查您的shell是否知道sshpass的位置
which sshpass如果没有给出任何输出,使用find命令查找可执行文件的位置:
find / -name sshpass如果找到路径,您可以使用可执行文件的完整路径:
/path/to/sshnpass或者将路径添加到path环境变量,以便您的shell可以找到它:
export PATH=$PATH:/path/to/或者问题可能是完全不同的。sshpass可能无法找到其他依赖项。可能未安装"ssh“客户端。或者您的语法可能是wrong
https://stackoverflow.com/questions/21375125
复制相似问题